Releases: commonmark/commonmark-java
commonmark-java 0.11.0
Added
- The extension for tables now also renders to plain text
(when using aTextContentRenderer
), 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
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 astextand 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
-
Support restricting which block types are parsed, see
enabledBlockTypes
method onParser.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 onParser.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
todependencyManagement
in parent pom, thanks @drobert
commonmark-java 0.8.0
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 additionaltagName
argument and is called for all HTML tags of a block. This allows users to add attributes for thepre
tag of a code block in addition tocode
. Also added attribute provider support for additional HTML tags, namelyem
,strong
,code
andbr
. (#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
- Allow to configure prefix/suffix for ID on
HeadingAnchorExtension
(#66), thanks @paulthom12345
commonmark-java 0.7.0
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.
- Renders a plain text representation of a document instead of HTML, see
- 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 artifactcommonmark-ext-heading-anchor
- Adds "id" attribute to heading tags (e.g.
- Ins (underline) extension (#54), thanks to @pabranch!
- Enables underlining of text by enclosing it in
++
. It's rendered as anins
tag in HTML. - Use class
InsExtension
in artifactcommonmark-ext-ins
.
- Enables underlining of text by enclosing it in
API changes:
HtmlRenderer
and related classes moved fromorg.commonmark.html
toorg.commonmark.renderer.html
HtmlRenderer.Builder
no longer takes anAttributeProvider
, but uses aAttributeProviderFactory
to instantiate a new provider for each rendering. Code needs to be changed to create a factory and then return the existing provider from itscreate
method, similar to node renderers.NodeRendererFactory
was renamed toHtmlNodeRendererFactory
, same for related classes (as there's a corresponsing interface for text content rendering)
commonmark-java 0.6.0
- Update to CommonMark spec 0.26 (#55)
- empty list items can no longer interrupt a paragraph; this resolves an ambiguity with setext headers
- ordered lists can interrupt a paragraph only when beginning with 1
- the two-blank-lines-breaks-out-of-lists rule has been removed
- the spec for emphasis and strong emphasis has been refined to give more intuitive results in some cases
- tabs can be used after the # in an ATX header and between the markers in a thematic break
- Fix max length for link labels (999, not 1000)
- Simplify and speed up brackets processing (links/images)
- Improves the nested brackets pathological case (e.g.
[[[[a]]]]
with a lot of brackets) - Also contributed these changes upstream to commonmark.js
- Improves the nested brackets pathological case (e.g.
ext-autolink: Update to autolink 0.5.0:
- Stop URLs at more invalid characters, notably '<' and '>'.
According to RFC 3987, angle brackets are not allowed in URLs, and
other linkers don't seem to allow them either.
Extension API changes:
- Extended
DelimiterProcessor
interface so that implementations get more information ingetDelimiterUse
and can reject delimiters by returning0
from it. Also rename the methods:getOpeningDelimiterChar
->getOpeningCharacter
getClosingDelimiterChar
->getClosingCharacter
getMinDelimiterCount
->getMinLength
Internal improvements:
- Simplify merging of adjacent text nodes
- Add coverage data to build. Currently at 97 %.
commonmark-java 0.5.1
- Fix
StringIndexOutOfBoundsException
on line after tab (#52)
commonmark-java 0.5.0
Update to CommonMark spec 0.25:
- Changes how partially consumed tabs are handled.
Features and fixes:
- Add YAML front matter extension for document metadata blocks (#24), thanks to @chiwanpark
- Add information about delimiter character and length to delimiter nodes (#10), thanks to @pcj
- Make HTML rendering for nodes extensible (#35)
- Make
AttributeProvider
work for image and table nodes (#31) - Add Android test project to build so that we won't break Android support (#38), thanks to @JinneeJ
- Fix blank line after empty list item to terminate list
- Fix nested bullet list indented with mix of tab and spaces (#41), thanks to @derari
- Fix package name in Javadoc, thanks to @jiakuan
ext-autolink: Update to autolink 0.4.0
- Treat more special characters as trailing delimiters to not include
">
,"/>
and");
at the end of URLs - Fix unexpected link end with unfinished delimiter pairs in URLs
- Fix Android incompatibility by not using
java.util.Objects
Extension API changes: