markdownToDiv function
Converts a markdown
document into a HTML in a div node.
Links are extended to accept attributes:
[Go to Google](https://www.google.com/){:target="_blank"}
markdown
The markdown document.
normalize
If true
normalizes indent.
Implementation
DivElement markdownToDiv(String markdown,
{bool normalize = true,
Iterable<mk.BlockSyntax>? blockSyntaxes,
Iterable<mk.InlineSyntax>? inlineSyntaxes,
mk.ExtensionSet? extensionSet,
mk.Resolver? linkResolver,
mk.Resolver? imageLinkResolver,
bool inlineOnly = false}) {
if (markdown.isEmpty) return createDivInline();
var html = markdownToHtml(markdown,
blockSyntaxes: blockSyntaxes,
inlineSyntaxes: inlineSyntaxes,
extensionSet: extensionSet,
linkResolver: linkResolver,
imageLinkResolver: imageLinkResolver,
inlineOnly: inlineOnly);
return createDivInline(html);
}