From 8377b89bfc97a85dbe90fb4cfa5dd33cd3568af4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 21 Feb 2016 10:09:47 +0000 Subject: Add style mappings for runs --- src/main/java/org/zwobble/mammoth/Mammoth.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main/java/org/zwobble/mammoth/Mammoth.java') diff --git a/src/main/java/org/zwobble/mammoth/Mammoth.java b/src/main/java/org/zwobble/mammoth/Mammoth.java index 4963c3a..e89e282 100644 --- a/src/main/java/org/zwobble/mammoth/Mammoth.java +++ b/src/main/java/org/zwobble/mammoth/Mammoth.java @@ -11,10 +11,7 @@ import org.zwobble.mammoth.docx.InMemoryDocxFile; import org.zwobble.mammoth.docx.ZippedDocxFile; import org.zwobble.mammoth.html.Html; import org.zwobble.mammoth.results.Result; -import org.zwobble.mammoth.styles.HtmlPath; -import org.zwobble.mammoth.styles.HtmlPathElement; -import org.zwobble.mammoth.styles.ParagraphMatcher; -import org.zwobble.mammoth.styles.StyleMap; +import org.zwobble.mammoth.styles.*; import org.zwobble.mammoth.util.Casts; import java.io.File; @@ -51,9 +48,14 @@ public class Mammoth { private static final StyleMap DEFAULT_STYLE_MAP = StyleMap.builder() .mapParagraph(ParagraphMatcher.styleName("footnote text"), HtmlPath.element("p")) + .mapRun(RunMatcher.styleName("footnote reference"), HtmlPath.EMPTY) .mapParagraph(ParagraphMatcher.styleName("endnote text"), HtmlPath.element("p")) + .mapRun(RunMatcher.styleName("endnote reference"), HtmlPath.EMPTY) + .mapParagraph(ParagraphMatcher.styleName("Footnote"), HtmlPath.element("p")) + .mapRun(RunMatcher.styleName("Footnote anchor"), HtmlPath.EMPTY) .mapParagraph(ParagraphMatcher.styleName("Endnote"), HtmlPath.element("p")) + .mapRun(RunMatcher.styleName("Endnote anchor"), HtmlPath.EMPTY) .mapParagraph( ParagraphMatcher.unorderedList("0"), @@ -61,6 +63,7 @@ public class Mammoth { HtmlPathElement.collapsible("ul"), HtmlPathElement.fresh("li")))) + .mapRun(RunMatcher.styleName("Hyperlink"), HtmlPath.EMPTY) .mapParagraph(ParagraphMatcher.styleName("Normal"), HtmlPath.element("p")) .build(); -- cgit v1.2.3