From 7f074c9d20d47b67f71642c536e39ef3006195ba Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 1 Apr 2017 16:30:06 +0100 Subject: Allow embedded style maps to be disabled --- Mammoth.Tests/DocumentConverterTests.cs | 8 ++++++++ Mammoth/DocumentConverter.cs | 4 ++++ 2 files changed, 12 insertions(+) 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 @@ -206,6 +206,14 @@ namespace Mammoth.Tests { ); } + [Fact] + public void embeddedStyleMapsCanBeDisabled() { + AssertSuccessfulConversion( + ConvertToHtml("embedded-style-map.docx", mammoth => mammoth.DisableEmbeddedStyleMap()), + "

Walking on imported air

" + ); + } + [Fact] public void CanExtractRawTextFromFile() { AssertSuccessfulConversion( 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 ConvertToHtml(Stream stream) { return new InternalDocumentConverter(options) -- cgit v1.2.3