Skip to content

Releases: discourse/markbridge

v0.2.0

11 Jun 23:20

Choose a tag to compare

What's Changed

⚠️ Breaking Changes

The migration API was redesigned around structured result types (#30). UPGRADING.md has before/after examples for every change.

  • parse_* methods now return a Parse and *_to_markdown / convert return a Conversion instead of raw Strings — use Conversion#markdown (or #to_s) for the output (#30)
  • Global configuration is gone: Markbridge::Configuration, .configure, .reset_defaults!, and all default_* accessors were removed — build a reusable renderer with Markbridge.discourse_renderer(...) and pass it via renderer: (#30)
  • tags:, tag_library:, escaper:, and escape_hard_line_breaks: were removed from the per-call signatures; *_to_markdown / convert accept only handlers:, renderer:, and raise_on_error: (#30)
  • Proc/lambda handlers are no longer supported — handlers must be objects responding to #process(...) (#30)
  • MediaWiki parser kwarg renamed: inline_tag_registry:handlers: (#30)
  • TextFormatter handlers must accept a processor: keyword (#30)

✨ Features

  • Markbridge.discourse_renderer(...) factory builds reusable Renderer instances — accepts tags:, tag_library:, unregister:, escaper:, escape:, escape_hard_line_breaks:, allow:, postprocessor:, strip_trailing_invisibles: (#30)
  • Markbridge.convert(format:) dispatcher and polymorphic Markbridge.render(Parse | AST::Node) (#30)
  • AST mutation between parse and render: block form on every *_to_markdown / convert, plus AST::Element#each_descendant, #descendants(klass = nil), and #replace_child(old, new) (#30)
  • raise_on_error: false collects render errors on Conversion#errors for per-row failure isolation in batch migrations (#30)
  • Selective Markdown escaping via MarkdownEscaper#allow: (:bullet_list, :ordered_list, :atx_heading, :block_quote, alias :lists), and IdentityEscaper / discourse_renderer(escape: false) for already-trusted Markdown (#30)
  • Handler registries gain #overlay(name) { |previous| ... } for wrapping default handlers (BBCode, HTML, TextFormatter) (#30)
  • TagLibrary#unregister — unregistered AST classes auto-pass-through to their rendered children (#30)
  • HTML and TextFormatter parsers accept pre-parsed Nokogiri input (DocumentFragment, Document, Element) in addition to Strings (#30)
  • AST::Details + DetailsTag for Discourse [details=…]…[/details] collapsible sections (#30)
  • Optional strip_trailing_invisibles config flag (#39)
  • Collapse whitespace in HTML per spec (#36)
  • Map inline span styles to AST formatting nodes (#34)

🐛 Bug Fixes

  • Make RenderContext parent-queries answer is_a? semantics (#42)
  • Move ] label-escape into MarkdownEscaper so image-in-link works (#41)
  • Escape ] in link labels to prevent early link termination (#40)
  • Insert blank line between raw text and following block elements (#37)
  • Skip [u] wrapper inside [url] and [email] (#36)
  • Skip [u] wrapper when underline content is whitespace-only (#35)
  • Treat Unicode whitespace as whitespace in RenderingInterface#wrap_inline (#33)

Full Changelog: v0.1.3...v0.2.0

v0.1.3

07 May 19:44

Choose a tag to compare

What's Changed

🐛 Bug Fixes

  • Treat \r as part of CRLF terminator in MarkdownEscaper (#32)

Full Changelog: v0.1.2...v0.1.3

v0.1.2

05 May 22:21

Choose a tag to compare

What's Changed

✨ Features

  • Make BBCode HandlerRegistry and Discourse TagLibrary enumerable (#28)

🐛 Bug Fixes

  • Name receiver class in AST::Element#<< type error (#28)
  • Copy text into a fresh buffer in AST::Text (#28)
  • Render Markdown as HTML inside the table fallback (html_mode) (#26)

Full Changelog: v0.1.1...v0.1.2

v0.1.1

24 Apr 13:08

Choose a tag to compare

What's Changed

✨ Features

  • Add Markdown table support with HTML fallback (#13)

🐛 Bug Fixes

  • Drop raw-text and metadata HTML elements entirely (#16)
  • Emit trailing blank line after quotes (#21)
  • Emit trailing blank line after more block-level tags (#22)

Full Changelog: v0.1.0...v0.1.1

v0.1.0

31 Mar 18:33

Choose a tag to compare