Search in sources :

Example 1 with CreoleLanguage

use of org.eclipse.mylyn.wikitext.creole.CreoleLanguage in project mylyn.docs by eclipse.

the class CreoleLanguageTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    parser = new MarkupParser(new CreoleLanguage());
}
Also used : CreoleLanguage(org.eclipse.mylyn.wikitext.creole.CreoleLanguage) MarkupParser(org.eclipse.mylyn.wikitext.parser.MarkupParser)

Example 2 with CreoleLanguage

use of org.eclipse.mylyn.wikitext.creole.CreoleLanguage in project mylyn.docs by eclipse.

the class CreoleLanguageTest method testDiscoverable.

public void testDiscoverable() {
    MarkupLanguage language = ServiceLocator.getInstance().getMarkupLanguage("Creole");
    assertNotNull(language);
    assertTrue(language instanceof CreoleLanguage);
}
Also used : CreoleLanguage(org.eclipse.mylyn.wikitext.creole.CreoleLanguage) MarkupLanguage(org.eclipse.mylyn.wikitext.parser.markup.MarkupLanguage)

Example 3 with CreoleLanguage

use of org.eclipse.mylyn.wikitext.creole.CreoleLanguage in project mylyn.docs by eclipse.

the class ParagraphBlock method processLineContent.

@Override
public int processLineContent(String line, int offset) {
    if (blockLineCount == 0) {
        builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
    }
    if (markupLanguage.isEmptyLine(line)) {
        setClosed(true);
        return 0;
    }
    CreoleLanguage markupLanguage = (CreoleLanguage) getMarkupLanguage();
    // paragraphs can have nested lists and other things
    for (Block block : markupLanguage.getParagraphBreakingBlocks()) {
        if (block.canStart(line, offset)) {
            setClosed(true);
            return 0;
        }
    }
    if (blockLineCount > 0) {
        // $NON-NLS-1$
        builder.characters("\n");
    }
    ++blockLineCount;
    markupLanguage.emitMarkupLine(getParser(), state, line, offset);
    return -1;
}
Also used : CreoleLanguage(org.eclipse.mylyn.wikitext.creole.CreoleLanguage) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) Block(org.eclipse.mylyn.wikitext.parser.markup.Block)

Aggregations

CreoleLanguage (org.eclipse.mylyn.wikitext.creole.CreoleLanguage)3 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)1 MarkupParser (org.eclipse.mylyn.wikitext.parser.MarkupParser)1 Block (org.eclipse.mylyn.wikitext.parser.markup.Block)1 MarkupLanguage (org.eclipse.mylyn.wikitext.parser.markup.MarkupLanguage)1