Search in sources :

Example 1 with Paragraph

use of org.commonmark.node.Paragraph in project gitiles by GerritCodeReview.

the class MarkdownToHtml method visit.

private void visit(BlockNote node) {
    html.open("div").attribute("class", node.getClassName());
    Node f = node.getFirstChild();
    if (f == node.getLastChild() && f instanceof Paragraph) {
        // Avoid <p> inside <div> if there is only one <p>.
        visitChildren(f);
    } else {
        visitChildren(node);
    }
    html.close("div");
}
Also used : Node(org.commonmark.node.Node) CustomNode(org.commonmark.node.CustomNode) Paragraph(org.commonmark.node.Paragraph)

Aggregations

CustomNode (org.commonmark.node.CustomNode)1 Node (org.commonmark.node.Node)1 Paragraph (org.commonmark.node.Paragraph)1