aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mammoth.Tests/DocumentConverterTests.cs8
-rw-r--r--Mammoth/DocumentConverter.cs4
2 files changed, 12 insertions, 0 deletions
diff --git a/Mammoth.Tests/DocumentConverterTests.cs b/Mammoth.Tests/DocumentConverterTests.cs
index 3b8ca6a..416893f 100644
--- a/Mammoth.Tests/DocumentConverterTests.cs
+++ b/Mammoth.Tests/DocumentConverterTests.cs
@@ -207,6 +207,14 @@ namespace Mammoth.Tests {
}
[Fact]
+ public void embeddedStyleMapsCanBeDisabled() {
+ AssertSuccessfulConversion(
+ ConvertToHtml("embedded-style-map.docx", mammoth => mammoth.DisableEmbeddedStyleMap()),
+ "<p>Walking on imported air</p>"
+ );
+ }
+
+ [Fact]
public void CanExtractRawTextFromFile() {
AssertSuccessfulConversion(
new DocumentConverter().ExtractRawText(TestFilePath("simple-list.docx")),
diff --git a/Mammoth/DocumentConverter.cs b/Mammoth/DocumentConverter.cs
index eb8c939..59b09e1 100644
--- a/Mammoth/DocumentConverter.cs
+++ b/Mammoth/DocumentConverter.cs
@@ -29,6 +29,10 @@ namespace Mammoth {
public DocumentConverter DisableDefaultStyleMap() {
return new DocumentConverter(options.disableDefaultStyleMap());
}
+
+ public DocumentConverter DisableEmbeddedStyleMap() {
+ return new DocumentConverter(options.disableEmbeddedStyleMap());
+ }
public IResult<string> ConvertToHtml(Stream stream) {
return new InternalDocumentConverter(options)