use of com.vladsch.flexmark.ast.util.HeadingCollectingVisitor in project flexmark-java by vsch.
the class TocNodeRenderer method render.
private void render(TocBlock node, NodeRendererContext context, HtmlWriter html) {
HeadingCollectingVisitor visitor = new HeadingCollectingVisitor();
List<Heading> headings = visitor.collectAndGetHeadings(node.getDocument());
if (headings != null) {
TocOptionsParser optionsParser = new TocOptionsParser();
TocOptions options = optionsParser.parseOption(node.getStyle(), this.options.withTitle(""), null).getFirst();
renderTocHeaders(context, html, node, headings, options);
}
}
use of com.vladsch.flexmark.ast.util.HeadingCollectingVisitor in project flexmark-java by vsch.
the class SimTocNodeRenderer method render.
private void render(SimTocBlock node, NodeRendererContext context, HtmlWriter html) {
HeadingCollectingVisitor visitor = new HeadingCollectingVisitor();
List<Heading> headings = visitor.collectAndGetHeadings(node.getDocument());
if (headings != null) {
SimTocOptionsParser optionsParser = new SimTocOptionsParser();
TocOptions options = optionsParser.parseOption(node.getStyle(), this.options, null).getFirst();
if (node.getTitle().isNotNull()) {
options = options.withTitle(node.getTitle().unescape());
}
renderTocHeaders(context, html, node, headings, options);
}
}
Aggregations