Releases: commonmark/commonmark-java
Releases Β· commonmark/commonmark-java
commonmark-java 0.27.0
Added
-
Autolink extension: Now supports configuration of different link types that
should be recognized and converted to links. SeeAutolinkExtension#builderType Default? Description URLYes URL with a protocol such as https://example.comEMAILYes Email address such as [email protected]WWWYes Address beginning with wwwsuch aswww.example.comNote that this changes the behavior of
AutolinkExtension.create()to now also
includeWWWlinks by default. To re-enable the previous behavior, use:AutolinkExtension.builder().linkTypes(AutolinkType.URL, AutolinkType.EMAIL).build();
commonmark-java 0.26.0
Changed
- A
LinkProcessorusingreplaceWithnow also stops outer links from being
parsed as links, same as withwrapTextIn. This prevents nested links, see
footnotes change below.
Fixed
- Fix rendering of image alt text to include contents of code spans (
`code`). (#398) - footnotes: Fix footnotes nested within links. Before, both the link and the
footnote reference would be parsed and lead to nested<a>elements, which
is disallowed. Now, only the footnote is parsed and the outer link becomes
plain text; this matches the behavior of links. (#400)
commonmark-java 0.25.1
Fixed
- footnotes: Fix parsing of footnote definitions containing multiple paragraphs
separated by blank lines. Before it only worked if paragraphs were separated
by lines of 4 spaces. (#388)
commonmark-java 0.25.0
Added
- Include OSGi metadata in jars (
META-INF/MANIFEST.MFfiles) (#378) - More documentation with examples for
Nodeclasses (#370)
Changed
- GitHub tables: Tables are now parsed even if there's no blank line before the
table heading, matching GitHub's behavior. (#381)
Fixed
MarkdownRenderer: Fix precedence fornodeRendererFactory: Factories passed
to the builder can now override rendering for core node types. (#368)MarkdownRenderer: Fix exception with ordered lists with a long first number
followed by a shorter one (#382)- Fix warning in Eclipse about "missing 'requires transitive'" (#358)
- Fix Android incompatibility with
requireNonNullElseGet(#369)
commonmark-java 0.24.0
Added
SourceSpanon nodes now have agetInputIndexto 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
substringinstead of having to split the input into lines first (#348)- Configurable line break rendering for
TextContentRenderervialineBreakRendering
on the builder; e.g.LineBreakRendering.SEPARATE_BLOCKSwill 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
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 inFootnotesExtension.Builder - Use class
FootnotesExtensionin artifactcommonmark-ext-footnotes(#332)
- Syntax:
- New option
omitSingleParagraphPinHtmlRenderer.Builderfor not using<p>
tags for when a document only has one paragraph (#150) - Support for custom link processing during inline parsing (e.g.
[foo]),
seeParser.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
DefaultUrlSanitizernow also allowsdataas a protocol. Use the
constructor with a list to customize this. (#329) LinkReferenceDefinitionnow extendsBlock(it was extendingNode
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
Added
- New
MarkdownRendererfor 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 oldAutomatic-Module-Namemanifest entries were removed - New package
org.commonmark.parser.betacontaining 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.textfor text related utilities that are useful for
both parsing and rendering TableCellnow hasgetWidthreturning the number of dash and colon characters
in the delimiter row, useful for rendering proportional width tables (#296)ThematicBreaknow hasgetLiteralcontaining the string that was used in the
source when parsing (#309)ListItemnow hasgetMarkerIndentandgetContentIndentfor 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
LinkReferenceDefinitionhaving nullSourceSpanwhen title is present
and parsing with source spans option enabled (#310)
commonmark-java 0.21.0
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,StrikethroughExtensioncan now be
configured to require two tildes like before, see Javadoc. (#271)
commonmark-java 0.20.0
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
Added
- YAML front matter extension: Limited support for single and double
quoted string values (#260)
Changed
- Check argument of
enabledBlockTypeswhen building parser instead of NPEing later