Skip to content

commonmark-java 0.7.0

Choose a tag to compare

@robinst robinst released this 23 Sep 05:41

New features:

  • Plain text content renderer (#58), thanks to @JinneeJ!
    • Renders a plain text representation of a document instead of HTML, see TextContentRenderer in core.
    • Extensible in the same way as HTML rendering.
  • Heading anchor extension (#26), thanks to @paulthom12345!
    • Adds "id" attribute to heading tags (e.g. <h1 id="heading">Heading</h1>), useful for linking to sections of a document.
    • ID generation logic can also be used by itself via the IdGenerator class.
    • Use class HeadingAnchorExtension in artifact commonmark-ext-heading-anchor
  • Ins (underline) extension (#54), thanks to @pabranch!
    • Enables underlining of text by enclosing it in ++. It's rendered as an ins tag in HTML.
    • Use class InsExtension in artifact commonmark-ext-ins.

API changes:

  • HtmlRenderer and related classes moved from org.commonmark.html to org.commonmark.renderer.html
  • HtmlRenderer.Builder no longer takes an AttributeProvider, but uses a AttributeProviderFactory to instantiate a new provider for each rendering. Code needs to be changed to create a factory and then return the existing provider from its create method, similar to node renderers.
  • NodeRendererFactory was renamed to HtmlNodeRendererFactory, same for related classes (as there's a corresponsing interface for text content rendering)