use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method testBlockCode.
public void testBlockCode() {
builder.beginDocument();
builder.beginBlock(BlockType.CODE, new Attributes());
builder.characters("text\n\nmore text");
builder.endBlock();
builder.endDocument();
String markup = out.toString();
assertEquals("bc.. text\n\nmore text\n\n", markup);
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method assertSpan.
private void assertSpan(String expected, SpanType spanType) {
builder.beginDocument();
builder.characters("begin");
builder.beginSpan(spanType, new Attributes());
builder.characters("span text");
builder.endSpan();
builder.characters("end");
builder.endDocument();
String markup = out.toString();
assertEquals(expected, markup);
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method testProtectionAgainstNestedSpans.
public void testProtectionAgainstNestedSpans() {
builder.beginDocument();
builder.beginSpan(SpanType.SPAN, new Attributes(null, null, "color:blue;", null));
builder.characters("first");
builder.beginSpan(SpanType.SPAN, new Attributes(null, null, "text-decoration:underline;", null));
builder.characters(" second");
builder.endSpan();
builder.endSpan();
builder.endDocument();
String markup = out.toString();
assertEquals("%{color:blue;}first second%\n\n", markup);
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method testBulletedListWithNestedSublist.
public void testBulletedListWithNestedSublist() {
builder.beginDocument();
builder.beginBlock(BlockType.BULLETED_LIST, new Attributes());
builder.beginBlock(BlockType.LIST_ITEM, new Attributes());
builder.characters("first");
builder.beginBlock(BlockType.BULLETED_LIST, new Attributes());
emitListItem("first.1");
emitListItem("first.2");
// list
builder.endBlock();
// list item
builder.endBlock();
emitListItem("second");
// list
builder.endBlock();
builder.endDocument();
String markup = out.toString();
assertEquals("* first\n** first.1\n** first.2\n* second\n", markup);
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method testParagraphFollowingExtendedBlockCode.
public void testParagraphFollowingExtendedBlockCode() {
builder.beginDocument();
builder.beginBlock(BlockType.CODE, new Attributes());
builder.characters("text\n\nmore text");
builder.endBlock();
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.characters("text");
builder.endBlock();
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.characters("text2");
builder.endBlock();
builder.endDocument();
String markup = out.toString();
assertEquals("bc.. text\n\nmore text\n\np. text\n\ntext2\n\n", markup);
}
Aggregations