Java Code Examples for org.commonmark.parser.Parser#Builder

The following examples show how to use org.commonmark.parser.Parser#Builder . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JLatexMathPluginTest.java    From Markwon with Apache License 2.0 5 votes vote down vote up
@Test
public void block_parser_registered() {
    final JLatexMathPlugin plugin = JLatexMathPlugin.create(0);
    final Parser.Builder builder = mock(Parser.Builder.class);
    plugin.configureParser(builder);
    verify(builder, times(1)).customBlockParserFactory(any(BlockParserFactory.class));
}
 
Example 2
Source File: JLatexMathPlugin.java    From Markwon with Apache License 2.0 5 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {
    // @since 4.3.0
    if (config.blocksEnabled) {
        if (config.blocksLegacy) {
            builder.customBlockParserFactory(new JLatexMathBlockParserLegacy.Factory());
        } else {
            builder.customBlockParserFactory(new JLatexMathBlockParser.Factory());
        }
    }
}
 
Example 3
Source File: MarkwonInlineParserPlugin.java    From Markwon with Apache License 2.0 4 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {
    builder.inlineParserFactory(factoryBuilder.build());
}
 
Example 4
Source File: ImageAttributesExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void extend(Parser.Builder parserBuilder) {
    parserBuilder.customDelimiterProcessor(new ImageAttributesDelimiterProcessor());
}
 
Example 5
Source File: AutolinkExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void extend(Parser.Builder parserBuilder) {
    parserBuilder.postProcessor(new AutolinkPostProcessor());
}
 
Example 6
Source File: MarkdownTableExtension.java    From js-dossier with Apache License 2.0 4 votes vote down vote up
@Override
public void extend(Parser.Builder builder) {
  builder.customBlockParserFactory(new TableBlockParser.Factory());
}
 
Example 7
Source File: InsExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void extend(Parser.Builder parserBuilder) {
    parserBuilder.customDelimiterProcessor(new InsDelimiterProcessor());
}
 
Example 8
Source File: TablesExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void extend(Parser.Builder parserBuilder) {
    parserBuilder.customBlockParserFactory(new TableBlockParser.Factory());
}
 
Example 9
Source File: NoticeBlockExtension.java    From maven-confluence-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public void extend(Parser.Builder builder) {
    builder.customBlockParserFactory(new NoticeBlockParser.Factory());

}
 
Example 10
Source File: TablePlugin.java    From Markwon with Apache License 2.0 4 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {
    builder.extensions(Collections.singleton(TablesExtension.create()));
}
 
Example 11
Source File: EmojiExtension.java    From mvvm-template with GNU General Public License v3.0 4 votes vote down vote up
@Override public void extend(Parser.Builder parserBuilder) {
    parserBuilder.customDelimiterProcessor(new EmojiDelimiterProcessor());
}
 
Example 12
Source File: SimpleExtPlugin.java    From Markwon with Apache License 2.0 4 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {
    for (DelimiterProcessor processor : this.builder.build()) {
        builder.customDelimiterProcessor(processor);
    }
}
 
Example 13
Source File: IconPlugin.java    From Markwon with Apache License 2.0 4 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {
    builder.customDelimiterProcessor(IconProcessor.create());
}
 
Example 14
Source File: TaskListPlugin.java    From Markwon with Apache License 2.0 4 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {
    builder.customBlockParserFactory(new TaskListBlockParser.Factory());
}
 
Example 15
Source File: TableEntryPlugin.java    From Markwon with Apache License 2.0 4 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {
    builder.extensions(Collections.singleton(TablesExtension.create()));
}
 
Example 16
Source File: TaskListItemsExtension.java    From commonmark-java with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void extend(Parser.Builder parserBuilder) {
    parserBuilder.postProcessor(new TaskListItemPostProcessor());
}
 
Example 17
Source File: StrikethroughPlugin.java    From Markwon with Apache License 2.0 4 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {
    builder.extensions(Collections.singleton(StrikethroughExtension.create()));
}
 
Example 18
Source File: MentionExtension.java    From mvvm-template with GNU General Public License v3.0 4 votes vote down vote up
@Override public void extend(Parser.Builder parserBuilder) {
    parserBuilder.customDelimiterProcessor(new MentionDelimiterProcessor());
}
 
Example 19
Source File: MarkwonPlugin.java    From Markwon with Apache License 2.0 2 votes vote down vote up
/**
 * Method to configure <code>org.commonmark.parser.Parser</code> (for example register custom
 * extension, etc).
 */
void configureParser(@NonNull Parser.Builder builder);
 
Example 20
Source File: AbstractMarkwonPlugin.java    From Markwon with Apache License 2.0 2 votes vote down vote up
@Override
public void configureParser(@NonNull Parser.Builder builder) {

}