Search in sources :

Example 26 with ImageAttributes

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

the class MarkdownDocumentBuilderTest method testImageImplicitParagraph.

public void testImageImplicitParagraph() {
    builder.beginDocument();
    builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
    builder.characters("Below is an image:");
    builder.endBlock();
    builder.image(new ImageAttributes(), "/path/to/img.jpg");
    builder.endDocument();
    assertMarkup("Below is an image:\n\n![](/path/to/img.jpg)\n\n");
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes)

Example 27 with ImageAttributes

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

the class MarkdownDocumentBuilderTest method testImageNoUrl.

public void testImageNoUrl() {
    builder.beginDocument();
    ImageAttributes attr = new ImageAttributes();
    attr.setAlt("Alt text");
    attr.setTitle("Optional title");
    builder.image(attr, null);
    builder.endDocument();
    assertMarkup("![Alt text]( \"Optional title\")\n\n");
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes)

Example 28 with ImageAttributes

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

the class ConfluenceDocumentBuilderTest method image.

@Test
public void image() {
    builder.beginDocument();
    builder.characters("a ");
    builder.image(new ImageAttributes(), "fooImage.png");
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("a !fooImage.png! test\n\n", markup);
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Test(org.junit.Test)

Example 29 with ImageAttributes

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

the class ConfluenceDocumentBuilderTest method imageWithTitle.

@Test
public void imageWithTitle() {
    builder.beginDocument();
    builder.characters("a ");
    ImageAttributes attributes = new ImageAttributes();
    attributes.setTitle("a value");
    builder.image(attributes, "fooImage.png");
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("a !fooImage.png|title=\"a value\"! test\n\n", markup);
}
Also used : ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Test(org.junit.Test)

Example 30 with ImageAttributes

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

the class ConfluenceDocumentBuilderTest method imageLink.

@Test
public void imageLink() {
    builder.beginDocument();
    builder.characters("a ");
    builder.imageLink(new LinkAttributes(), new ImageAttributes(), "#foo", "fooImage.png");
    builder.characters(" test");
    builder.endDocument();
    String markup = out.toString();
    assertEquals("a !fooImage.png!:#foo test\n\n", markup);
}
Also used : LinkAttributes(org.eclipse.mylyn.wikitext.parser.LinkAttributes) ImageAttributes(org.eclipse.mylyn.wikitext.parser.ImageAttributes) Test(org.junit.Test)

Aggregations

ImageAttributes (org.eclipse.mylyn.wikitext.parser.ImageAttributes)38 Test (org.junit.Test)17 LinkAttributes (org.eclipse.mylyn.wikitext.parser.LinkAttributes)10 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)3 ImageLinkEvent (org.eclipse.mylyn.wikitext.parser.builder.event.ImageLinkEvent)3 ImageEvent (org.eclipse.mylyn.wikitext.parser.builder.event.ImageEvent)2 Align (org.eclipse.mylyn.wikitext.parser.ImageAttributes.Align)1 TableAttributes (org.eclipse.mylyn.wikitext.parser.TableAttributes)1 TableCellAttributes (org.eclipse.mylyn.wikitext.parser.TableCellAttributes)1