From 8dd12c1ca7703a085b57fe4c5c35ef6e19d92134 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 24 Feb 2016 09:04:14 +0000 Subject: Allow style maps to be added --- src/main/java/org/zwobble/mammoth/Mammoth.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 b8dac98..d7f5679 100644 --- a/src/main/java/org/zwobble/mammoth/Mammoth.java +++ b/src/main/java/org/zwobble/mammoth/Mammoth.java @@ -31,7 +31,7 @@ public class Mammoth { private final DocumentToHtmlOptions options; public Mammoth() { - this(DocumentToHtmlOptions.DEFAULT.styleMap(DefaultStyles.DEFAULT_STYLE_MAP)); + this(DocumentToHtmlOptions.DEFAULT.addStyleMap(DefaultStyles.DEFAULT_STYLE_MAP)); } private Mammoth(DocumentToHtmlOptions options) { @@ -46,6 +46,10 @@ public class Mammoth { return new Mammoth(options.preserveEmptyParagraphs()); } + public Mammoth addStyleMap(String styleMap) { + return new Mammoth(options.addStyleMap(styleMap)); + } + public Result convertToHtml(InputStream stream) throws IOException { return withDocxFile(stream, zipFile -> convertToHtml(Optional.empty(), zipFile)); -- cgit v1.2.3