Search in sources :

Example 1 with TracWikiLanguage

use of org.eclipse.mylyn.wikitext.tracwiki.TracWikiLanguage in project mylyn.docs by eclipse.

the class TracWikiLanguageTest method setUp.

@Override
public void setUp() {
    markupLanguage = new TracWikiLanguage();
    parser = new MarkupParser(markupLanguage);
}
Also used : TracWikiLanguage(org.eclipse.mylyn.wikitext.tracwiki.TracWikiLanguage) MarkupParser(org.eclipse.mylyn.wikitext.parser.MarkupParser)

Example 2 with TracWikiLanguage

use of org.eclipse.mylyn.wikitext.tracwiki.TracWikiLanguage in project mylyn.docs by eclipse.

the class ParagraphBlock method processLineContent.

@Override
public int processLineContent(String line, int offset) {
    if (blockLineCount == 0) {
        Attributes attributes = new Attributes();
        builder.beginBlock(BlockType.PARAGRAPH, attributes);
    }
    if (markupLanguage.isEmptyLine(line)) {
        setClosed(true);
        return -1;
    }
    ++blockLineCount;
    TracWikiLanguage markupLanguage = (TracWikiLanguage) 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 != 1) {
        // note: newlines don't automatically convert to line breaks
        // $NON-NLS-1$
        builder.characters("\n");
    }
    markupLanguage.emitMarkupLine(getParser(), state, line, offset);
    return -1;
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) Block(org.eclipse.mylyn.wikitext.parser.markup.Block) TracWikiLanguage(org.eclipse.mylyn.wikitext.tracwiki.TracWikiLanguage)

Example 3 with TracWikiLanguage

use of org.eclipse.mylyn.wikitext.tracwiki.TracWikiLanguage in project mylyn.docs by eclipse.

the class TracWikiLanguageTest method testDiscoverable.

public void testDiscoverable() {
    // $NON-NLS-1$
    MarkupLanguage language = ServiceLocator.getInstance().getMarkupLanguage("TracWiki");
    assertNotNull(language);
    assertTrue(language instanceof TracWikiLanguage);
}
Also used : MarkupLanguage(org.eclipse.mylyn.wikitext.parser.markup.MarkupLanguage) TracWikiLanguage(org.eclipse.mylyn.wikitext.tracwiki.TracWikiLanguage)

Aggregations

TracWikiLanguage (org.eclipse.mylyn.wikitext.tracwiki.TracWikiLanguage)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