aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/DocumentConverter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/zwobble/mammoth/DocumentConverter.java')
-rw-r--r--src/main/java/org/zwobble/mammoth/DocumentConverter.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/zwobble/mammoth/DocumentConverter.java b/src/main/java/org/zwobble/mammoth/DocumentConverter.java
index feba5ac..2dea8e8 100644
--- a/src/main/java/org/zwobble/mammoth/DocumentConverter.java
+++ b/src/main/java/org/zwobble/mammoth/DocumentConverter.java
@@ -1,5 +1,6 @@
package org.zwobble.mammoth;
+import org.zwobble.mammoth.images.ImageConverter;
import org.zwobble.mammoth.internal.InternalDocumentConverter;
import org.zwobble.mammoth.internal.conversion.DocumentToHtmlOptions;
@@ -60,6 +61,14 @@ public class DocumentConverter {
}
/**
+ * By default, images are converted to {@code <img>} elements with the source included inline in the {@code src} attribute.
+ * Call this to change how images are converted.
+ */
+ public DocumentConverter imageConverter(ImageConverter.ImgElement imageConverter) {
+ return new DocumentConverter(options.imageConverter(imageConverter));
+ }
+
+ /**
* Converts {@code stream} into an HTML string.
* Note that using this method instead of {@link #convertToHtml(File file)}
* means that relative paths to other files, such as images, cannot be resolved.