Skip to content
Markbridge logo

Your markup, in Markdown.

Convert BBCode, HTML, MediaWiki, and s9e TextFormatter XML with one Ruby library. Inspect the content and choose how it renders.
require "markbridge/bbcode"
result = Markbridge.bbcode_to_markdown(
"[b]Hello[/b] [url=https://example.com]world[/url]!"
)
result.markdown # => "**Hello** [world](https://example.com)!"

The shipped renderer produces Discourse-flavored Markdown. The parsers and AST are independent of the renderer, so you can use the same parsed content for your own output format.

Review your content

Read the Markdown, unknown tags, and diagnostics from one result. Use them to find content that needs attention. Understand result objects.

Use your own rules

Add a parser handler, edit the AST, or customize a renderer tag. Reuse your configuration across conversions. Customize Markbridge.

  1. Parse your input. Each parser builds the same kind of AST.
  2. Inspect or edit the AST. Your code can change nodes before normalization prepares them for Markdown.
  3. Render the result. Use the Discourse renderer or write your own renderer for the shared AST.

Read the architecture guide for the details.

You can convert post bodies, track unknown tags, and resolve uploads, users, and internal links in your own code. The migration guide explains how these parts work together.

Source version: Markbridge 0.4.3Documentation text indexThis page as Markdown