use of org.eclipse.mylyn.wikitext.parser.outline.OutlineParser in project mylyn.docs by eclipse.
the class XslfoDocumentBuilderIntegrationTest method testforTableSpan_bug336813.
public void testforTableSpan_bug336813() {
final String markup = "{|\n|-\n" + "| Column 1 || Column 2 || Column 3\n" + "|-\n" + "| rowspan=\"2\"| A\n" + "| colspan=\"2\" | B\n" + "|-\n" + "| C <!-- column 1 occupied by cell A -->\n" + "| D \n" + "|-\n" + "| E\n" + "| rowspan=\"2\" colspan=\"2\" | F\n" + "|- \n" + "| G <!-- column 2+3 occupied by cell F -->\n" + "|- \n" + "| colspan=\"3\" | H\n" + "|}";
documentBuilder.getConfiguration().setPageNumbering(true);
documentBuilder.getConfiguration().setTitle("Title");
OutlineItem op = new OutlineParser(new MediaWikiLanguage()).parse(markup);
documentBuilder.setOutline(op);
parser.setMarkupLanguage(new MediaWikiLanguage());
parser.parse(markup, true);
final String xslfo = out.toString();
// Test for rowspan
assertTrue(Pattern.compile("<table-cell number-rows-spanned=\"2\" padding-left=\"2pt\" padding-right=\"2pt\" padding-top=\"2pt\" padding-bottom=\"2pt\">").matcher(xslfo).find());
// Test for colspan
assertTrue(Pattern.compile("<table-cell number-columns-spanned=\"2\" padding-left=\"2pt\" padding-right=\"2pt\" padding-top=\"2pt\" padding-bottom=\"2pt\">").matcher(xslfo).find());
}
use of org.eclipse.mylyn.wikitext.parser.outline.OutlineParser in project mylyn.docs by eclipse.
the class XslfoDocumentBuilderIntegrationTest method testForXslFoBookmarks_bug336592.
public void testForXslFoBookmarks_bug336592() {
final String markup = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n= Bookmark H1 =\n== Bookmark H2 ==\n";
documentBuilder.getConfiguration().setPageNumbering(true);
documentBuilder.getConfiguration().setTitle("Title");
OutlineItem op = new OutlineParser(new MediaWikiLanguage()).parse(markup);
documentBuilder.setOutline(op);
parser.setMarkupLanguage(new MediaWikiLanguage());
parser.parse(markup, true);
final String xslfo = out.toString();
assertTrue(Pattern.compile("<bookmark-tree>\\s*<bookmark internal-destination=\"Bookmark_H1\">\\s*<bookmark-title>Bookmark H1</bookmark-title>\\s*<bookmark internal-destination=\"Bookmark_H2\">\\s*<bookmark-title>Bookmark H2</bookmark-title>\\s*</bookmark>\\s*</bookmark>\\s*</bookmark-tree>").matcher(xslfo).find());
}
use of org.eclipse.mylyn.wikitext.parser.outline.OutlineParser in project mylyn.docs by eclipse.
the class XslfoDocumentBuilderIntegrationTest method testforTableRowAlign_bug336813.
public void testforTableRowAlign_bug336813() {
final String markup = "{|\n" + "|- valign=\"top\"\n |'''Row heading'''\n" + "| A longer piece of text. Lorem ipsum...\n |A shorter piece of text.\n" + "|- style=\"vertical-align: bottom;\"\n |'''Row heading'''\n" + "|A longer piece of text. Lorem ipsum... \n |A shorter piece of text.\n" + "|}";
documentBuilder.getConfiguration().setPageNumbering(true);
documentBuilder.getConfiguration().setTitle("Title");
OutlineItem op = new OutlineParser(new MediaWikiLanguage()).parse(markup);
documentBuilder.setOutline(op);
parser.setMarkupLanguage(new MediaWikiLanguage());
parser.parse(markup, true);
final String xslfo = out.toString();
// From "valign" attribute
assertTrue(Pattern.compile("<table-row display-align=\"before\">").matcher(xslfo).find());
// From css styling
assertTrue(Pattern.compile("<table-row display-align=\"after\">").matcher(xslfo).find());
}
use of org.eclipse.mylyn.wikitext.parser.outline.OutlineParser in project mylyn.docs by eclipse.
the class MarkupToEclipseToc method parse.
public String parse(String markupContent) {
if (markupLanguage == null) {
// $NON-NLS-1$
throw new IllegalStateException("Must set markupLanguage");
}
OutlineParser parser = new OutlineParser(markupLanguage);
OutlineItem root = parser.parse(markupContent);
return createToc(root);
}
use of org.eclipse.mylyn.wikitext.parser.outline.OutlineParser in project mylyn.docs by eclipse.
the class WikiTextSourceEditor method initializeOutlineParser.
private void initializeOutlineParser() {
synchronized (WikiTextSourceEditor.this) {
if (outlineParser == null) {
outlineParser = new OutlineParser();
outlineParser.setLabelMaxLength(48);
outlineModel = outlineParser.createRootItem();
}
}
}
Aggregations