aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Docx
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-02-03 11:57:07 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-02-03 11:57:07 +0100
commit23e6495624682f0c8d130a3f6db5dc60056015fa (patch)
treede7558f1c8b8b6f97ba6cf0127e7baa95ddb824c /src/Text/Pandoc/Readers/Docx
parent5cd475be7057487ba4f63e2257b6f65b975acd58 (diff)
downloadpandoc-23e6495624682f0c8d130a3f6db5dc60056015fa.tar.gz
Docx reader: Don't drop smartTag contents.
This just parses inside smartTags and yields their contents, ignoring the attributes of the smartTag. @jkr, you may want to adjust this, but I wanted to get a fix in as fast as possible for the dropped content. Closes #2242; see also #3412.
Diffstat (limited to 'src/Text/Pandoc/Readers/Docx')
-rw-r--r--src/Text/Pandoc/Readers/Docx/Parse.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs
index 6cd3a49b6..0532b5497 100644
--- a/src/Text/Pandoc/Readers/Docx/Parse.hs
+++ b/src/Text/Pandoc/Readers/Docx/Parse.hs
@@ -218,6 +218,7 @@ data ParPart = PlainRun Run
| Drawing FilePath String String B.ByteString Extent -- title, alt
| Chart -- placeholder for now
| PlainOMath [Exp]
+ | SmartTag [Run]
deriving Show
data Run = Run RunStyle [RunElem]
@@ -709,6 +710,10 @@ elemToParPart ns element
runs <- mapD (elemToRun ns) (elChildren element)
return $ Deletion cId cAuthor cDate runs
elemToParPart ns element
+ | isElem ns "w" "smartTag" element = do
+ runs <- mapD (elemToRun ns) (elChildren element)
+ return $ SmartTag runs
+elemToParPart ns element
| isElem ns "w" "bookmarkStart" element
, Just bmId <- findAttr (elemName ns "w" "id") element
, Just bmName <- findAttr (elemName ns "w" "name") element =