Releases: discourse/markbridge
Releases · discourse/markbridge
v0.2.0
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 aParseand*_to_markdown/convertreturn aConversioninstead of rawStrings — useConversion#markdown(or#to_s) for the output (#30)- Global configuration is gone:
Markbridge::Configuration,.configure,.reset_defaults!, and alldefault_*accessors were removed — build a reusable renderer withMarkbridge.discourse_renderer(...)and pass it viarenderer:(#30) tags:,tag_library:,escaper:, andescape_hard_line_breaks:were removed from the per-call signatures;*_to_markdown/convertaccept onlyhandlers:,renderer:, andraise_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 reusableRendererinstances — acceptstags:,tag_library:,unregister:,escaper:,escape:,escape_hard_line_breaks:,allow:,postprocessor:,strip_trailing_invisibles:(#30)Markbridge.convert(format:)dispatcher and polymorphicMarkbridge.render(Parse | AST::Node)(#30)- AST mutation between parse and render: block form on every
*_to_markdown/convert, plusAST::Element#each_descendant,#descendants(klass = nil), and#replace_child(old, new)(#30) raise_on_error: falsecollects render errors onConversion#errorsfor per-row failure isolation in batch migrations (#30)- Selective Markdown escaping via
MarkdownEscaper#allow:(:bullet_list,:ordered_list,:atx_heading,:block_quote, alias:lists), andIdentityEscaper/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+DetailsTagfor 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
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
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
v0.1.0
Full Changelog: https://github.com/discourse/markbridge/commits/v0.1.0