use of org.eclipse.mylyn.wikitext.twiki.TWikiLanguage 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 0;
}
TWikiLanguage textileLanguage = (TWikiLanguage) getMarkupLanguage();
for (Block block : textileLanguage.getParagraphBreakingBlocks()) {
if (block.canStart(line, offset)) {
setClosed(true);
return 0;
}
}
if (blockLineCount != 0) {
builder.lineBreak();
}
++blockLineCount;
textileLanguage.emitMarkupLine(getParser(), state, line, offset);
return -1;
}
use of org.eclipse.mylyn.wikitext.twiki.TWikiLanguage in project mylyn.docs by eclipse.
the class LiteralBlock method processLineContent.
@Override
public int processLineContent(String line, int offset) {
if (blockLineCount++ == 0) {
offset = matcher.start(1);
((TWikiLanguage) markupLanguage).setLiteralMode(true);
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
} else {
Matcher endMatcher = endPattern.matcher(line);
if (endMatcher.matches()) {
setClosed(true);
return endMatcher.start(1);
}
}
markupLanguage.emitMarkupLine(parser, state, line, offset);
// $NON-NLS-1$
builder.characters("\n");
return -1;
}
use of org.eclipse.mylyn.wikitext.twiki.TWikiLanguage in project mylyn.docs by eclipse.
the class TWikiLanguageTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
language = new TWikiLanguage();
parser = new MarkupParser(language);
}
use of org.eclipse.mylyn.wikitext.twiki.TWikiLanguage in project mylyn.docs by eclipse.
the class TWikiLanguageTest method testDiscoverable.
public void testDiscoverable() {
MarkupLanguage language = ServiceLocator.getInstance().getMarkupLanguage("TWiki");
assertNotNull(language);
assertTrue(language instanceof TWikiLanguage);
}
use of org.eclipse.mylyn.wikitext.twiki.TWikiLanguage in project mylyn.docs by eclipse.
the class TableOfContentsBlock method processLineContent.
@Override
public int processLineContent(String line, int offset) {
if (blockLineNumber++ > 0) {
setClosed(true);
return 0;
}
if (!getMarkupLanguage().isFilterGenerativeContents()) {
OutlineParser outlineParser = new OutlineParser(new TWikiLanguage());
OutlineItem rootItem = outlineParser.parse(state.getMarkupContent());
emitToc(rootItem);
}
return -1;
}
Aggregations