use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileTest method testLeftPaddingCssClass.
public void testLeftPaddingCssClass() {
Pattern pattern = Pattern.compile("h1" + Textile.REGEX_BLOCK_ATTRIBUTES + "\\. (.*)?");
Matcher matcher = pattern.matcher("h1(((foo). foo");
assertTrue(matcher.matches());
Attributes attributes = new Attributes();
Textile.configureAttributes(attributes, matcher, 1, true);
assertEquals("padding-left: 2em;", attributes.getCssStyle());
assertEquals("foo", attributes.getCssClass());
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileTest method testRightAlignment.
public void testRightAlignment() {
Pattern pattern = Pattern.compile("h1" + Textile.REGEX_BLOCK_ATTRIBUTES + "\\. (.*)?");
Matcher matcher = pattern.matcher("h1>. foo");
assertTrue(matcher.matches());
Attributes attributes = new Attributes();
Textile.configureAttributes(attributes, matcher, 1, true);
assertEquals("text-align: right;", attributes.getCssStyle());
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileTest method testLeftAlignment.
public void testLeftAlignment() {
Pattern pattern = Pattern.compile("h1" + Textile.REGEX_BLOCK_ATTRIBUTES + "\\. (.*)?");
Matcher matcher = pattern.matcher("h1<. foo");
assertTrue(matcher.matches());
Attributes attributes = new Attributes();
Textile.configureAttributes(attributes, matcher, 1, true);
assertEquals("text-align: left;", attributes.getCssStyle());
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class TextileTest method testLeftPadding.
public void testLeftPadding() {
Pattern pattern = Pattern.compile("h1" + Textile.REGEX_BLOCK_ATTRIBUTES + "\\. (.*)?");
Matcher matcher = pattern.matcher("h1((. foo");
assertTrue(matcher.matches());
Attributes attributes = new Attributes();
Textile.configureAttributes(attributes, matcher, 1, true);
assertEquals("padding-left: 2em;", attributes.getCssStyle());
}
use of org.eclipse.mylyn.wikitext.parser.Attributes in project mylyn.docs by eclipse.
the class FootnoteBlock method processLineContent.
@Override
public int processLineContent(String line, int offset) {
if (blockLineCount == 0) {
Attributes attributes = new Attributes();
// $NON-NLS-1$
attributes.setCssClass("footnote");
// 0-offset matches may start with the "fnnn. " prefix.
footnote = matcher.group(1);
((TextileContentState) state).footnoteBlockDetected(footnote);
attributes.setId(state.getFootnoteId(footnote));
Textile.configureAttributes(attributes, matcher, 2, true);
offset = matcher.start(LINE_REMAINDER_GROUP_OFFSET);
builder.beginBlock(BlockType.PARAGRAPH, attributes);
builder.beginSpan(SpanType.SUPERSCRIPT, new Attributes());
builder.characters(footnote);
builder.endSpan();
// $NON-NLS-1$
builder.characters(" ");
}
if (markupLanguage.isEmptyLine(line)) {
setClosed(true);
return 0;
}
if (blockLineCount != 0) {
builder.lineBreak();
}
++blockLineCount;
getMarkupLanguage().emitMarkupLine(getParser(), state, line, offset);
return -1;
}
Aggregations