use of org.eclipse.mylyn.wikitext.parser.LinkAttributes in project mylyn.docs by eclipse.
the class AsciiDocDocumentBuilder method link.
@Override
public void link(Attributes attributes, String hrefOrHashName, String text) {
assertOpenBlock();
LinkAttributes linkAttr = new LinkAttributes();
linkAttr.setTitle(attributes.getTitle());
linkAttr.setHref(hrefOrHashName);
beginSpan(SpanType.LINK, linkAttr);
if (Strings.isNullOrEmpty(text)) {
characters(hrefOrHashName);
} else {
characters(text);
}
endSpan();
}
use of org.eclipse.mylyn.wikitext.parser.LinkAttributes in project mylyn.docs by eclipse.
the class DocBookDocumentBuilderTest method testSpanLinkWithNullHref.
public void testSpanLinkWithNullHref() {
builder.beginDocument();
builder.characters("a ");
LinkAttributes attributes = new LinkAttributes();
attributes.setId("some.id");
builder.beginSpan(SpanType.LINK, attributes);
builder.endSpan();
builder.characters(" test");
builder.endDocument();
String docbook = out.toString();
String expectedContent = "a <anchor id=\"some.id\"></anchor> test";
assertEquals(DOCBOOK_BEGIN + expectedContent + DOCBOOK_END, docbook);
}
use of org.eclipse.mylyn.wikitext.parser.LinkAttributes in project mylyn.docs by eclipse.
the class DocBookDocumentBuilderTest method testLink.
public void testLink() {
builder.beginDocument();
builder.characters("a ");
builder.link(new LinkAttributes(), "#foo", "link to foo");
builder.characters(" test");
builder.endDocument();
String docbook = out.toString();
String expectedContent = "a <link linkend=\"foo\">link to foo</link> test";
assertEquals(DOCBOOK_BEGIN + expectedContent + DOCBOOK_END, docbook);
}
use of org.eclipse.mylyn.wikitext.parser.LinkAttributes in project mylyn.docs by eclipse.
the class EventDocumentBuilderTest method link.
@Test
public void link() {
builder.link(new LinkAttributes(), "https://example.com", "test");
assertEvents(new LinkEvent(new LinkAttributes(), "https://example.com", "test"));
}
use of org.eclipse.mylyn.wikitext.parser.LinkAttributes in project mylyn.docs by eclipse.
the class HtmlDocumentBuilder2Test method testHtmlLinkWithNullHref.
public void testHtmlLinkWithNullHref() {
// Bug 492302
LinkAttributes attributes = new LinkAttributes();
attributes.setId("lorem");
builder.link(attributes, null, "");
assertContainsPattern("<a id=\"lorem\"></a>");
}
Aggregations