Skip to content

Releases: commonmark/commonmark-java

commonmark-parent-0.14.0

20 Jul 10:40

Choose a tag to compare

Added

  • Add sanitizeUrls to HtmlRenderer.Builder to enable sanitizing URLs
    of <a> and <img> tags. Sanitizing logic can be customized via
    urlSanitizer. Thanks @VandorpeDavid

commonmark-java 0.13.1

25 Nov 06:20

Choose a tag to compare

Fixed

  • Fix potential StackOverflowError for regular expressions used in the
    inline parser (e.g. when parsing long HTML), thanks @lehvolk

commonmark-java 0.13.0

16 Jul 01:27

Choose a tag to compare

Added

  • LinkReferenceDefinition nodes are now part of the document (not
    rendered by default).
  • InlineParserContext.getLinkReferenceDefinition was added to allow
    custom inline parsers to look up definitions for reference links.

Changed

  • Performance improvements compared to previous version 🚀:
    • Parsing 7-10% faster
    • HTML rendering 105% faster - or in other words, twice as fast!
  • Update to CommonMark spec 0.29 (#156):
    • Change how newlines/spaces are handled in inline code
    • Info strings for tilde code blocks can contain backticks and tildes
    • Allow spaces inside link destinations in pointy brackets
    • Disallow link destination beginning with < unless it is inside <..>
    • Disallow unescaped '(' in link title in parens
    • Disallow indenting list item marker by more than 3 spaces
    • No longer treat <meta> as a block tag
    • Link reference definitions can now be in setext headings too
  • Tables extension: Changes to match GitHub implementation:
    • Escaping now only considers pipe characters when parsing tables:
      \| results in a literal | instead of a column, everything else
      is passed through to inline parsing.
    • Table body can now contain lazy continuation lines (without |).
      An empty line or another block is needed to interrupt the table.
    • For tables without a body, <tbody> is no longer rendered in HTML
    • See https://github.github.com/gfm/#tables-extension- for details
  • Check non-null arguments early and provide a nicer message

Fixed

  • Fix incorrectly preserving HTML entities when rendering attributes
  • Fix pathological case with input [\\\\... (a lot of backslashes)
  • Fix pathological case with input []([]([](...

commonmark-java 0.12.1

22 Nov 00:31

Choose a tag to compare

Changed

  • 🚀 Speed up parsing significantly: Compared to the previous version, the
    benchmarks show up to 55% faster parsing for both small and large
    documents! (#137, #140)
  • Parse backslash followed by unescapable character the same way as
    the reference implementations.
  • Build and test on Java 11 as well.
  • autolink: Stop URLs at " and ` as well

Fixed

  • Fix tab handling in ATX and Setext headings.

commonmark-java 0.11.0

17 Jan 23:32

Choose a tag to compare

Added

  • The extension for tables now also renders to plain text
    (when using a TextContentRenderer), thanks @ahjaworski

Changed

  • Add Automatic-Module-Name manifest entries so that library can be used
    nicely in Java 9 modules. The module names correspond to the root
    package name: org.commonmark, org.commonmark.ext.autolink, etc.
  • Java 7 is now only supported on a best-effort basis (but it has been
    EOL for quite some time, so yeah)

commonmark-java 0.10.0

19 Sep 07:26

Choose a tag to compare

Added

  • Support multiple DelimiterProcessor with the same delimiter char as long
    as they have different length, thanks @szeiger
  • Add tests for thread-safety and a section to the readme (#83)

Changed

  • Update to CommonMark spec 0.28 (#94):
    • Adapt to changed emphasis parsing rule
    • Allow nested parentheses in inline link destinations

Fixed

  • Fixes for text content rendering, thanks @JinneeJ:
    • Support for mixed lists
    • Fixed that whitespaces between text elements are removed in "stripped" mode.
      For example **text** and text had rendered as textand text
    • Improved rendering for auto links
  • Fix [\] being parsed as link label
  • Fix [foo](<\>) resulting in \ in href
  • Fix multiple of 3 rule for emphasis parsing (see commonmark/cmark#177)
  • Fix text node merging when opening/closing delimiters are adjacent (#96)
  • autolink: Fix linking of URLs without host, e.g. http://. (#99)

commonmark-java 0.9.0

03 Mar 06:54

Choose a tag to compare

  • Support restricting which block types are parsed, see enabledBlockTypes method on Parser.Builder (#43), thanks @marksliva, @pivotal-graham-bell and @lalunamel.

    This allows you to disable parsing of e.g. headings, they will just be parsed as paragraphs instead.

  • Allow customizing the inline parser, see inlineParserFactory method on Parser.Builder (#68), thanks @vreynolds and @lalunamel.

    Note that this is experimental and currently requires using internal classes.

  • Wrap escaped HTML blocks in a <p> tag (#78)

  • Add missing ext-heading-anchor to dependencyManagement in parent pom, thanks @drobert

commonmark-java 0.8.0

09 Dec 02:44

Choose a tag to compare

Update to CommonMark spec 0.27 (#73):

  • Treat h2..h6 as HTML blocks well
  • Allow shortcut reference link before open parenthesis (if parenthesis is not part of a valid inline link)

API changes:

  • AttributeProvider.setAttributes now has an additional tagName argument and is called for all HTML tags of a block. This allows users to add attributes for the pre tag of a code block in addition to code. Also added attribute provider support for additional HTML tags, namely em, strong, code and br. (#74)

ext-autolink:

  • Bump version of autolink-java dependency (no changes affecting extension)

ext-heading-anchor:

  • Fix IllegalArgumentException on Android (#71)

commonmark-java 0.7.1

05 Oct 04:01

Choose a tag to compare

  • Allow to configure prefix/suffix for ID on HeadingAnchorExtension (#66), thanks @paulthom12345

commonmark-java 0.7.0

23 Sep 05:41

Choose a tag to compare

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)