args
, update the markdown executable to be opted in.end
parameter. TagSyntax no longer implements onMatchEnd
. Instead, TagSyntax implements a method called close
which creates and returns a Node, if a Node can be created and closed at the current position. If the TagSyntax instance cannot create a Node at the current position, the method should return null
. Some TagSyntax subclasses will unconditionally create a tag in close
, while others may be unable to, such as LinkSyntax, if an inline or reference link could not be resolved.ListSyntax.removeLeadingEmptyLine
, ListSyntax.removeTrailingEmptyLines
, TableSyntax.parseAlignments
, TableSyntax.parseRow
.BlockSyntax.canEndBlock
from a getter to a method accepting a BlockParser.ListSyntax.removeLeadingEmptyLine
, ListSyntax.removeTrailingEmptyLines
, TableSyntax.parseAlignments
, TableSyntax.parseRow
. These will be made private in a major version bump as early as 3.0.0.encodeHtml
is false (e.g. when used in Flutter).startCharacter
, where a subclass can specify a single character to try to match, before matching with more expensive regular expressions.<pre>
(#263).>
handling by always encoding as >
– unless preceded by /
.blockquote
by always putting the closing tag on a new line.code
elements defined with “`”.<
, >
, and "
as their respective HTML entities when interpreted as text.encodeHtml
is false (e.g. when used in Flutter).&
within inline image titles.<3.0.0
, and adjust other dependencies.Breaking change: The Link
class has been renamed LinkReference
, and the Document
field, refLinks
, has been renamed linkReferences
.
Breaking change: Remove the deprecated ExtensionSet.gitHub
field. Use ExtensionSet.gitHubFlavored
instead.
Breaking change: Make all of the fields on Document
read-only.
Overhaul support for emphasis (*foo*
and _foo_
) and strong emphasis (**foo**
and __foo__
), dramatically improving CommonMark compliance.
Overhaul support for links and images, again dramatically improving CommonMark compliance.
Improve support for tab characters, and horizontal rules.
Add support for GitHub Flavored Markdown's Strikethrough extension. See the GFM spec.
The above fixes raise compliance with the CommonMark specs to 93%, and compliance with the GFM specs to 92%.
Add an encodeHtml
parameter to Document
, which defaults to true. When false, HTML entities (such as ©
and the <
character) will not be escaped, useful when rendering Markdown in some output format other than HTML.
Allow the binary script to take a --extension-set
option.
A reminder: You can run bin/markdown.dart
from anywhere via:
$ pub global activate markdown $ markdown
gitHubWeb
extension set.gitHub
ExtensionSet into two sets: gitHubFlavored
, which represents the GitHub Flavored Markdown spec, and gitHubWeb
, which represents what GitHub actually renders Markdown.accept
could cause an exception.escapeHtml
function.ExtensionSet.gitHub
to more closely align with GitHub markdown.escapeHtml
. This code exists in dart:convert
.dart bin/markdown.dart --version
now shows the package version number.TableSyntax
.ExtensionSet.gitHub
.tool/travis.sh
.tool/common_mark_stats.dart
, which resulted in a dramatic overestimate of our CommonMark compliance.[ ... ]
syntax when no resolver is specified (#92).code
element with a language-
prefix.![text](img.png)
would compile too <a href="img.prg"><img src="img.prg" alt="text"></img></a>
. That same code will now compile to <img src="img.png" alt="text" />
.[foo] (bar)
no longer renders as an inline link (#53).markdownToHtml()
and new Document()
will use the default extension set, which is ExtensionSet.commonMark
, which includes FencedCodeBlock.[foo]()
now renders as an inline link.[foo]\(bar) ==> <p>[foo](bar)</p>
.\\\n
or \n (#30, #60).peek(int linesAhead)
, meant for use in subclasses.blocksInList
and determineBlockItems()
, meant for use in subclasses.LinkSyntax.resolved
, InlineParser.currentSource
.Formatted code.
Updated readme.