Search in sources :

Example 1 with ProcessingContext

use of org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext in project mylyn.docs by eclipse.

the class CommonMarkLanguage method processContent.

@Override
public void processContent(MarkupParser parser, String markupContent, boolean asDocument) {
    checkNotNull(parser);
    checkNotNull(markupContent);
    DocumentBuilder builder = checkNotNull(parser.getBuilder());
    if (asDocument) {
        builder.beginDocument();
    }
    SourceBlocks sourceBlocks = CommonMark.sourceBlocks();
    ProcessingContext context = createContext(sourceBlocks, markupContent);
    sourceBlocks.process(context, builder, LineSequence.create(markupContent));
    if (asDocument) {
        builder.endDocument();
    }
}
Also used : ProcessingContext(org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext) DocumentBuilder(org.eclipse.mylyn.wikitext.parser.DocumentBuilder) SourceBlocks(org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks)

Example 2 with ProcessingContext

use of org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext in project mylyn.docs by eclipse.

the class InlineTest method createContext.

@Test
public void createContext() {
    ProcessingContextBuilder builder = ProcessingContext.builder();
    new Inline(new Line(1, 2, "text"), 0, 1) {

        @Override
        public void emit(DocumentBuilder builder) {
        }
    }.createContext(builder);
    ProcessingContext context = builder.build();
    assertTrue(context.isEmpty());
}
Also used : Line(org.eclipse.mylyn.wikitext.commonmark.internal.Line) ProcessingContext(org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext) DocumentBuilder(org.eclipse.mylyn.wikitext.parser.DocumentBuilder) ProcessingContextBuilder(org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContextBuilder) Test(org.junit.Test)

Aggregations

ProcessingContext (org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContext)2 DocumentBuilder (org.eclipse.mylyn.wikitext.parser.DocumentBuilder)2 Line (org.eclipse.mylyn.wikitext.commonmark.internal.Line)1 ProcessingContextBuilder (org.eclipse.mylyn.wikitext.commonmark.internal.ProcessingContextBuilder)1 SourceBlocks (org.eclipse.mylyn.wikitext.commonmark.internal.SourceBlocks)1 Test (org.junit.Test)1