Skip to content

Releases: commonmark/commonmark-java

commonmark-java 0.24.0

21 Oct 12:24
Compare
Choose a tag to compare

Added

  • SourceSpan on nodes now have a getInputIndex to get the index within the
    original input string (in addition to the existing line/column indexes).
    This is useful when looking up the input source: It can now be done using
    substring instead of having to split the input into lines first (#348)
  • Configurable line break rendering for TextContentRenderer via lineBreakRendering
    on the builder; e.g. LineBreakRendering.SEPARATE_BLOCKS will render an empty
    line between blocks (#344)

Changed

  • Adopted small changes from OpenJDK vendoring to make updates easier for them (#343)

Fixed

  • Enable overriding of built-in node rendering for TextContentRenderer (#346)

commonmark-java 0.23.0

18 Sep 08:26
Compare
Choose a tag to compare

Added

  • New extension for footnotes!
    • Syntax:
      Main text[^1]
      
      [^1]: Additional text in a footnote
      
    • Inline footnotes like ^[inline footnote] are also supported when enabled
      via an option in FootnotesExtension.Builder
    • Use class FootnotesExtension in artifact commonmark-ext-footnotes (#332)
  • New option omitSingleParagraphP in HtmlRenderer.Builder for not using <p>
    tags for when a document only has one paragraph (#150)
  • Support for custom link processing during inline parsing (e.g. [foo]),
    see Parser.Builder#linkProcessor
  • Support for extending inline parsing with custom inline content parsers. See
    Parser.Builder#customInlineContentParserFactory. This allows users/extensions
    to hook into inline parsing on a deeper level than before (e.g. with delimiter
    processors). It can be used to add support for math/latex formulas or other inline
    syntax. (#321)

Changed

  • The default DefaultUrlSanitizer now also allows data as a protocol. Use the
    constructor with a list to customize this. (#329)
  • LinkReferenceDefinition now extends Block (it was extending Node
    directly before)
  • MarkdownRenderer: Don't escape = text if it's the first node in a block (#335)

Fixed

  • Fix parsing of link reference definitions with incorrect title syntax (followed
    by characters other than space/tab). In that case, the title was set to the
    partially-parsed title and the source spans were wrong. (#315)
  • Fix source spans of blocks with lazy continuation lines (#337)
  • MarkdownRenderer: Preserve thematic break literals (#331)

commonmark-java 0.22.0

15 Mar 11:51
Compare
Choose a tag to compare

Added

  • New MarkdownRenderer for rendering nodes to Markdown (CommonMark)!
    Note that while care is taken to produce equivalent Markdown, some differences
    in the original Markdown (if parsed) are not preserved, such as:
    • The type of heading used
    • The type of link used (reference links will be rendered as inline links)
    • Whether special characters are escaped or not
    • Leading and trailing whitespace
  • Modular JAR (JPMS): All artifacts now include module descriptors (module-info)
    so jlink can be used; the old Automatic-Module-Name manifest entries were removed
  • New package org.commonmark.parser.beta containing classes that are not part of
    the stable API but are exported from the module because they might be useful for
    extension parsers
  • New package org.commonmark.text for text related utilities that are useful for
    both parsing and rendering
  • TableCell now has getWidth returning the number of dash and colon characters
    in the delimiter row, useful for rendering proportional width tables (#296)
  • ThematicBreak now has getLiteral containing the string that was used in the
    source when parsing (#309)
  • ListItem now has getMarkerIndent and getContentIndent for retrieving the
    space between the start of the line and the marker/content
  • Deprecated a some properties of BulletList, OrderedList, FencedCodeBlock
    and replaced with nullable ones because they might not be set when constructing
    these nodes manually instead of via parsing

Changed

  • Java 11 or later is now required (dropping support for Java 8)
  • Update to CommonMark spec 0.31.2

Fixed

  • Fix LinkReferenceDefinition having null SourceSpan when title is present
    and parsing with source spans option enabled (#310)

commonmark-java 0.21.0

17 Nov 03:01
Compare
Choose a tag to compare

Added

  • GitHub strikethrough: With the previous version we adjusted the
    extension to also accept the single tilde syntax. But if you use
    another extension that uses the single tilde syntax, you will get a
    conflict. To avoid that, StrikethroughExtension can now be
    configured to require two tildes like before, see Javadoc. (#271)

commonmark-java 0.20.0

20 Oct 02:27
Compare
Choose a tag to compare

Fixed

  • GitHub tables: A single pipe (optional whitespace) now ends a table
    instead of crashing or being treated as an empty row, for consistency
    with GitHub (#255).
  • GitHub strikethrough: A single tilde now also works, and more than two
    tildes are not accepted anymore. This brings us in line with what
    GitHub actually does, which is a bit underspecified (#267)
  • The autolink extension now handles source spans correctly (#209)

commonmark-java 0.19.0

02 Jun 05:59
Compare
Choose a tag to compare

Added

  • YAML front matter extension: Limited support for single and double
    quoted string values (#260)

Changed

  • Check argument of enabledBlockTypes when building parser instead of NPEing later

commonmark-java 0.18.2

02 Jun 05:48
Compare
Choose a tag to compare

Changed

  • Test against Java 17
  • Bundle LICENSE.txt with artifacts (in addition to Maven metadata)

commonmark-java 0.18.1

02 Jun 05:48
Compare
Choose a tag to compare

Fixed

  • Fix tables with leading/trailing header pipes and trailing spaces (#244).
    This was a regression in 0.16.1 which is now fixed.

commonmark-java 0.18.0

01 Jul 01:23
Compare
Choose a tag to compare

Changed

  • Update to CommonMark spec 0.30:
    • Add textarea to list of literal HTML block tags.
      Like script, style, and pre, textarea blocks can contain
      blank lines without the contents being interpreted as commonmark.
    • Fix case folding for link reference labels in some cases
      (e.g. and SS should match)
    • Allow lowercase ASCII in HTML declaration
    • Don't let type 7 HTML blocks interrupt lazy paragraphs either
  • Preserve the original case for the label of LinkReferenceDefinition.
    Before, we used to store the normalized version (lowercase, collapsed whitespace).

commonmark-java 0.17.2

14 May 13:44
Compare
Choose a tag to compare

Changed

  • Pass original instead of normalized label to InlineParserContext for lookup (#204).
    This allows custom contexts to change the lookup logic and have access to the original
    label content.
    In case you have a custom implementation of InlineParserContext, you might need to adjust
    it to do normalization.