Search in sources :

Example 1 with HtmlDocumentHandler

use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentHandler in project mylyn.docs by eclipse.

the class HtmlSubsetLanguageTest method cloneSupported.

@Test
public void cloneSupported() {
    HtmlDocumentHandler documentHandler = new HtmlDocumentHandler() {

        @Override
        public void endDocument(HtmlDocumentBuilder builder, XmlStreamWriter writer) {
        // ignore
        }

        @Override
        public void beginDocument(HtmlDocumentBuilder builder, XmlStreamWriter writer) {
        // ignore
        }
    };
    HtmlSubsetLanguage language = new HtmlSubsetLanguage("Test", documentHandler, 6, Sets.newHashSet(BlockType.PARAGRAPH, BlockType.DIV, BlockType.QUOTE), Sets.newHashSet(SpanType.CITATION, SpanType.EMPHASIS), ImmutableMap.of(SpanType.EMPHASIS, "new-em"), Collections.<SpanHtmlElementStrategy>emptyList(), false, true);
    HtmlSubsetLanguage cloned = language.clone();
    assertEquals(language.getName(), cloned.getName());
    assertEquals(language.getSupportedBlockTypes(), cloned.getSupportedBlockTypes());
    assertEquals(language.getSupportedHeadingLevel(), cloned.getSupportedHeadingLevel());
    assertEquals(language.getSupportedSpanTypes(), cloned.getSupportedSpanTypes());
    assertEquals(language.getTagNameSubstitutions(), cloned.getTagNameSubstitutions());
}
Also used : HtmlDocumentHandler(org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentHandler) XmlStreamWriter(org.eclipse.mylyn.wikitext.util.XmlStreamWriter) HtmlDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder) Test(org.junit.Test)

Example 2 with HtmlDocumentHandler

use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentHandler in project mylyn.docs by eclipse.

the class CommonMarkAsserts method createDocumentBuilder.

private static DocumentBuilder createDocumentBuilder(StringWriter out) {
    HtmlDocumentBuilder builder = new SimplifiedHtmlDocumentBuilder(out);
    builder.setDocumentHandler(new HtmlDocumentHandler() {

        @Override
        public void endDocument(HtmlDocumentBuilder builder, XmlStreamWriter writer) {
        }

        @Override
        public void beginDocument(HtmlDocumentBuilder builder, XmlStreamWriter writer) {
        }
    });
    return builder;
}
Also used : SimplifiedHtmlDocumentBuilder(org.eclipse.mylyn.wikitext.commonmark.internal.spec.SimplifiedHtmlDocumentBuilder) HtmlDocumentHandler(org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentHandler) XmlStreamWriter(org.eclipse.mylyn.wikitext.util.XmlStreamWriter) HtmlDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder) SimplifiedHtmlDocumentBuilder(org.eclipse.mylyn.wikitext.commonmark.internal.spec.SimplifiedHtmlDocumentBuilder)

Aggregations

HtmlDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder)2 HtmlDocumentHandler (org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentHandler)2 XmlStreamWriter (org.eclipse.mylyn.wikitext.util.XmlStreamWriter)2 SimplifiedHtmlDocumentBuilder (org.eclipse.mylyn.wikitext.commonmark.internal.spec.SimplifiedHtmlDocumentBuilder)1 Test (org.junit.Test)1