use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testEmptyBlock.
@Test
public void testEmptyBlock() {
builder.beginDocument();
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.endBlock();
builder.endDocument();
assertMarkup("");
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testParagraphConsecutive.
@Test
public void testParagraphConsecutive() {
builder.beginDocument();
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.characters("Paragraph 1");
builder.endBlock();
builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
builder.characters("Paragraph 2");
builder.endBlock();
builder.endDocument();
assertMarkup("Paragraph 1\n\nParagraph 2\n\n");
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testLinkSpanEmptyAttributes.
@Test
public void testLinkSpanEmptyAttributes() {
builder.beginDocument();
builder.beginSpan(SpanType.LINK, new Attributes());
builder.characters("http://example.com");
builder.endSpan();
builder.endDocument();
assertMarkup("http://example.com\n\n");
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilderTest method testBlockQuote.
@Test
public void testBlockQuote() {
builder.beginDocument();
builder.beginBlock(BlockType.QUOTE, new Attributes());
builder.characters("A quote by someone important.");
builder.endBlock();
builder.endDocument();
assertMarkup("[quote]\n----\nA quote by someone important.\n----\n");
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class DefinitionListBlock method handleItem.
private void handleItem() {
String key = matcher.group(1);
String value = matcher.group(3);
int keyOffset = matcher.start(1);
int level = matcher.group(2).length();
if (isCurrentLevel(level)) {
closeItemBlockIfOpen();
} else if (isNewLevel(level)) {
openLevel(level);
} else {
dropToLevel(level);
}
state.setLineCharacterOffset(keyOffset);
state.setLineSegmentEndOffset(keyOffset + key.length());
// $NON-NLS-1$
builder.beginBlock(BlockType.DEFINITION_TERM, new Attributes(null, "hdlist1", null, null));
markupLanguage.emitMarkupLine(parser, state, keyOffset, key, 0);
builder.endBlock();
if (value != null) {
int valueOffset = matcher.start(3);
openItemBlock(value, valueOffset);
}
}
Aggregations