aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-14 19:17:40 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-14 19:17:40 +0000
commit1632923e841ca8a3368345c763cdaa0fe2aa363b (patch)
tree454ff2745bb74f1c3f1d8a494269a1fa810953b0
parentb67455341838b1a05cd5d4c42824f8ed14d94cdc (diff)
Use collapsible elements for hyperlinks
-rw-r--r--src/main/java/org/zwobble/mammoth/DocumentConverter.java2
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/zwobble/mammoth/DocumentConverter.java b/src/main/java/org/zwobble/mammoth/DocumentConverter.java
index 32b649a..1865342 100644
--- a/src/main/java/org/zwobble/mammoth/DocumentConverter.java
+++ b/src/main/java/org/zwobble/mammoth/DocumentConverter.java
@@ -145,7 +145,7 @@ public class DocumentConverter {
@Override
public List<HtmlNode> visit(Hyperlink hyperlink) {
Map<String, String> attributes = map("href", generateHref(hyperlink));
- return list(Html.element("a", attributes, convertChildrenToHtml(hyperlink)));
+ return list(Html.collapsibleElement("a", attributes, convertChildrenToHtml(hyperlink)));
}
private String generateHref(Hyperlink hyperlink) {
diff --git a/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java b/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java
index d1ae6a3..665258b 100644
--- a/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java
+++ b/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java
@@ -124,14 +124,14 @@ public class DocumentConverterTests {
public void hyperlinkWithHrefIsConvertedToAnchorTag() {
assertThat(
convertToHtml(Hyperlink.href("http://example.com", list(new Text("Hello")))),
- deepEquals(list(Html.element("a", map("href", "http://example.com"), list(Html.text("Hello"))))));
+ deepEquals(list(Html.collapsibleElement("a", map("href", "http://example.com"), list(Html.text("Hello"))))));
}
@Test
public void hyperlinkWithInternalAnchorReferenceIsConvertedToAnchorTag() {
assertThat(
convertToHtml(Hyperlink.anchor("start", list(new Text("Hello")))),
- deepEquals(list(Html.element("a", map("href", "#doc-42-start"), list(Html.text("Hello"))))));
+ deepEquals(list(Html.collapsibleElement("a", map("href", "#doc-42-start"), list(Html.text("Hello"))))));
}
@Test