Commonmark Java Versions Save

Java library for parsing and rendering CommonMark (Markdown)

commonmark-parent-0.16.1

3 years ago

Added

  • Support for including source spans on block and inline nodes (#1):
    • Answer for "Where in the source input (line/column position and length) does this node come from?"
    • Useful for things like editors that want to keep the input and rendered output scrolled to the same lines, or start editing on the node that was selected.
    • Use includeSourceSpans on Parser.Builder to enable, either with IncludeSourceSpans.BLOCKS or IncludeSourceSpans.BLOCKS_AND_INLINES
    • Read data with Node.getSourceSpans
    • Note that enabling this has a small performance impact on parsing (about 10%)

Changed

  • In order to support source spans (see above), a few of the extension APIs changed. It should only affect users implementing their own extensions. See the Javadoc to see what changed.
  • YAML front matter extension: Support dots in key names

commonmark-parent-0.15.2

3 years ago

Fixed

  • image-attributes extension: Fix unexpected altering of text in case parsing of attributes fails, e.g. {NN} text -> {NN text}, thanks @jk1

commonmark-parent-0.15.1

3 years ago

Added

  • Add text content rendering support for InsExtension

commonmark-parent-0.15.0

3 years ago

Added

  • Extension for width/height attributes for images, thanks @dohertyfjatl
    • Syntax: ![text](/url.png){width=640 height=480}
    • Use class ImageAttributesExtension in artifact commonmark-ext-image-attributes
  • Extension for task lists (GitHub-style), thanks @dohertyfjatl
    • Syntax:
      - [x] task #1
      - [ ] task #2
      
    • Use class TaskListItemsExtension in artifact commonmark-ext-task-list-items

commonmark-parent-0.14.0

3 years ago

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-parent-0.13.1

4 years ago

Fixed

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

commonmark-parent-0.13.0

4 years ago

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-parent-0.12.1

5 years ago

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-parent-0.11.0

6 years ago

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-parent-0.10.0

6 years ago

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)