use of org.commonmark.node.Node in project hippo by NHS-digital-website.
the class ThematicBreakAttributeProviderTest method setsThematicBreakInlineCssClassOnCodeElement.
@Test
public void setsThematicBreakInlineCssClassOnCodeElement() {
// given
final Node thematicBreakNode = new ThematicBreak();
// when
thematicBreakAttributeProvider.setAttributes(thematicBreakNode, "tagName is ignored", attributes);
// then
then(attributes).should().put("class", "nhsd-a-horizontal-rule");
then(attributes).shouldHaveNoMoreInteractions();
}
use of org.commonmark.node.Node in project TOSCAna by StuPro-TOSCAna.
the class ReadmeBuilder method toString.
@Override
public String toString() {
Parser markdownParser = Parser.builder().build();
Node markdownDocument = markdownParser.parse(this.markdownText);
HtmlRenderer renderer = HtmlRenderer.builder().build();
return TEMPLATE.replace(README_TEMPLATE_TITLE_KEY, this.pageTitle).replace(README_TEMPLATE_BODY_KEY, renderer.render(markdownDocument));
}
use of org.commonmark.node.Node in project FastHub by k0shk0sh.
the class MarkDownProvider method stripMdText.
@NonNull
public static String stripMdText(String markdown) {
if (!InputHelper.isEmpty(markdown)) {
Parser parser = Parser.builder().build();
Node node = parser.parse(markdown);
return stripHtml(HtmlRenderer.builder().build().render(node));
}
return "";
}
use of org.commonmark.node.Node in project FastHub by k0shk0sh.
the class EmojiNodeRenderer method renderChildren.
private void renderChildren(Node parent) {
Node node = parent.getFirstChild();
while (node != null) {
Node next = node.getNext();
context.render(node);
node = next;
}
}
use of org.commonmark.node.Node in project symja_android_library by axkr.
the class DocumentationPod method generateHTMLString.
private static String generateHTMLString(final String markdownStr) {
Set<Extension> EXTENSIONS = Collections.singleton(TablesExtension.create());
Parser parser = Parser.builder().extensions(EXTENSIONS).build();
Node document = parser.parse(markdownStr);
HtmlRenderer renderer = HtmlRenderer.builder().extensions(EXTENSIONS).build();
return renderer.render(document);
}
Aggregations