Java源码示例:org.commonmark.node.ThematicBreak

示例1
@Override
public void configureSpansFactory(@NonNull MarkwonSpansFactory.Builder builder) {

    // reuse this one for both code-blocks (indent & fenced)
    final CodeBlockSpanFactory codeBlockSpanFactory = new CodeBlockSpanFactory();

    builder
            .setFactory(StrongEmphasis.class, new StrongEmphasisSpanFactory())
            .setFactory(Emphasis.class, new EmphasisSpanFactory())
            .setFactory(BlockQuote.class, new BlockQuoteSpanFactory())
            .setFactory(Code.class, new CodeSpanFactory())
            .setFactory(FencedCodeBlock.class, codeBlockSpanFactory)
            .setFactory(IndentedCodeBlock.class, codeBlockSpanFactory)
            .setFactory(ListItem.class, new ListItemSpanFactory())
            .setFactory(Heading.class, new HeadingSpanFactory())
            .setFactory(Link.class, new LinkSpanFactory())
            .setFactory(ThematicBreak.class, new ThematicBreakSpanFactory());
}
 
示例2
/**
 * @return a set with enabled by default block types
 * @since 4.4.0
 */
@NonNull
public static Set<Class<? extends Block>> enabledBlockTypes() {
    return new HashSet<>(Arrays.asList(
            BlockQuote.class,
            Heading.class,
            FencedCodeBlock.class,
            HtmlBlock.class,
            ThematicBreak.class,
            ListBlock.class,
            IndentedCodeBlock.class
    ));
}
 
示例3
@Override
public void visit(ThematicBreak thematicBreak) {
    visit((Node) thematicBreak);
}