JetBrains / markdown

Markdown parser written in kotlin
Apache License 2.0
706 stars 78 forks source link

[#124] Fix the java example #160

Open QCuncle opened 6 months ago

QCuncle commented 6 months ago

The java example in the document is incorrect, I have modified it to the correct example Before:

final String src = "Some *Markdown*";
final MarkdownFlavourDescriptor flavour = new GFMFlavourDescriptor();
final ASTNode parsedTree = new MarkdownParser(flavour).buildMarkdownTreeFromString(text);
final String html = new HtmlGenerator(src, parsedTree, flavour, false).generateHtml();

After:

final String src = "Some *Markdown*";
final MarkdownFlavourDescriptor flavour = new GFMFlavourDescriptor();
final ASTNode parsedTree = new MarkdownParser(flavour).buildMarkdownTreeFromString(src);
final String html = new HtmlGenerator(src, parsedTree, flavour, false)
        .generateHtml(new HtmlGenerator.DefaultTagRenderer(
        (astNode, charSequence, attributes) -> attributes,
        false)
        );