use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method paragraph.
private void paragraph(String text) {
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.characters(text);
builder.endBlock();
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method testLineBreak_ExplicitBlockAfterExtendedBlock.
public void testLineBreak_ExplicitBlockAfterExtendedBlock() {
builder.beginDocument();
// make sure paragraph is preceded by an extended block
builder.beginBlock(BlockType.CODE, new Attributes());
// multiple newlines makes this an extended block
builder.characters("one\n\n\ntwo");
builder.endBlock();
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.characters("line");
builder.lineBreak();
builder.characters("break");
builder.endBlock();
builder.endDocument();
String markup = out.toString();
assertEquals("bc.. one\n\n\ntwo\n\np. line\nbreak\n\n", markup);
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method testEmptyBoldSpan.
public void testEmptyBoldSpan() {
builder.beginDocument();
builder.characters("first ");
builder.beginSpan(SpanType.BOLD, new Attributes());
builder.endSpan();
builder.characters("second");
builder.endDocument();
String markup = out.toString();
assertEquals("first second\n\n", markup);
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method testBulletedListWithNestedSublist2.
public void testBulletedListWithNestedSublist2() {
builder.beginDocument();
builder.beginBlock(BlockType.BULLETED_LIST, new Attributes());
emitListItem("first");
builder.beginBlock(BlockType.LIST_ITEM, new Attributes());
builder.characters("second");
builder.beginBlock(BlockType.BULLETED_LIST, new Attributes());
emitListItem("second.1");
// list
builder.endBlock();
// list item
builder.endBlock();
// list
builder.endBlock();
builder.beginBlock(BlockType.NUMERIC_LIST, new Attributes());
emitListItem("third");
builder.beginBlock(BlockType.LIST_ITEM, new Attributes());
builder.characters("fourth");
builder.beginBlock(BlockType.NUMERIC_LIST, new Attributes());
emitListItem("fourth.1");
// list
builder.endBlock();
// list item
builder.endBlock();
// list
builder.endBlock();
builder.endDocument();
String markup = out.toString();
assertEquals("* first\n* second\n** second.1\n\n# third\n# fourth\n## fourth.1\n", markup);
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileDocumentBuilderTest method testImplicitParagrahWithSpan.
public void testImplicitParagrahWithSpan() {
builder.beginDocument();
builder.beginSpan(SpanType.STRONG, new Attributes());
builder.characters("text1");
builder.endSpan();
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.characters("text2");
builder.endBlock();
builder.endDocument();
String markup = out.toString();
assertEquals("*text1*\n\ntext2\n\n", markup);
}
Aggregations