aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/Mammoth.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-24 09:04:14 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-24 09:04:14 +0000
commit8dd12c1ca7703a085b57fe4c5c35ef6e19d92134 (patch)
tree2e2c47733e868a6a0deadceed8b1c564643bb2cc /src/main/java/org/zwobble/mammoth/Mammoth.java
parent9903fc49d41142934012a5ec2bf16d80f0cf4b16 (diff)
Allow style maps to be added
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/Mammoth.java')
-rw-r--r--src/main/java/org/zwobble/mammoth/Mammoth.java6
1 files changed, 5 insertions, 1 deletions
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<String> convertToHtml(InputStream stream) throws IOException {
return withDocxFile(stream, zipFile ->
convertToHtml(Optional.empty(), zipFile));