Search in sources :

Example 66 with Attributes

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

the class HtmlDocumentBuilderTest method blockPreformatted.

@Test
public void blockPreformatted() {
    builder.beginBlock(BlockType.PREFORMATTED, new Attributes());
    builder.characters("test");
    builder.endBlock();
    assertEquals("<pre>test</pre>", out.toString());
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) ListAttributes(org.eclipse.mylyn.wikitext.parser.ListAttributes) Test(org.junit.Test)

Example 67 with Attributes

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

the class MultiplexingDocumentBuilderTest method beginSpan.

@Test
public void beginSpan() {
    multiplexer.beginSpan(SpanType.DELETED, new Attributes());
    assertEvents(new BeginSpanEvent(SpanType.DELETED, new Attributes()));
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) HeadingAttributes(org.eclipse.mylyn.wikitext.parser.HeadingAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) BeginSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent) Test(org.junit.Test)

Example 68 with Attributes

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

the class BeginSpanEventTest method equals.

@Test
public void equals() {
    assertEquality(new BeginSpanEvent(SpanType.CODE, new Attributes()), new BeginSpanEvent(SpanType.CODE, new Attributes()));
    assertInequality(new BeginSpanEvent(SpanType.CODE, new Attributes()), new BeginSpanEvent(SpanType.BOLD, new Attributes()));
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) BeginSpanEvent(org.eclipse.mylyn.wikitext.parser.builder.event.BeginSpanEvent) Test(org.junit.Test)

Example 69 with Attributes

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

the class ImageEventTest method equals.

@Test
public void equals() {
    assertEquality(new ImageEvent(new Attributes(), "http://example.com/img.png"), new ImageEvent(new Attributes(), "http://example.com/img.png"));
    assertInequality(new ImageEvent(new Attributes(), "http://example.com/img.png"), new ImageEvent(new Attributes(), "http://example.com/img2.png"));
}
Also used : Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) ImageEvent(org.eclipse.mylyn.wikitext.parser.builder.event.ImageEvent) Test(org.junit.Test)

Example 70 with Attributes

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

the class TextileDocumentBuilderTest method testParagraph_MultipleNewlinesInParagraph.

public void testParagraph_MultipleNewlinesInParagraph() throws Exception {
    for (String newline : PLATFORM_NEWLINES) {
        setUp();
        builder.beginDocument();
        builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
        builder.characters("text" + newline + newline + "more text");
        builder.endBlock();
        builder.endDocument();
        String markup = out.toString();
        assertEquals("text more text\n\n", markup);
    }
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes)

Aggregations

Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)428 LinkAttributes (org.eclipse.mylyn.wikitext.parser.LinkAttributes)248 ImageAttributes (org.eclipse.mylyn.wikitext.parser.ImageAttributes)223 Test (org.junit.Test)176 Matcher (java.util.regex.Matcher)33 ListAttributes (org.eclipse.mylyn.wikitext.parser.ListAttributes)29 TableAttributes (org.eclipse.mylyn.wikitext.parser.TableAttributes)17 StringWriter (java.io.StringWriter)14 BlockType (org.eclipse.mylyn.wikitext.parser.DocumentBuilder.BlockType)12 HtmlDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder)10 Pattern (java.util.regex.Pattern)9 DocumentBuilder (org.eclipse.mylyn.wikitext.parser.DocumentBuilder)9 SpanStrategies (org.eclipse.mylyn.wikitext.html.internal.SpanStrategies)8 Block (org.eclipse.mylyn.wikitext.parser.markup.Block)8 SpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SpanStrategy)6 SubstitutionBlockStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionBlockStrategy)6 SubstitutionSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy)6 SubstitutionWithoutCssSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionWithoutCssSpanStrategy)6 TableCellAttributes (org.eclipse.mylyn.wikitext.parser.TableCellAttributes)6 EventDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder)6