diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2018-01-16 13:15:00 -0500 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2018-01-16 13:22:02 -0500 |
commit | 95d602d3b7df8946f236aaad310bedf8fdc2e09f (patch) | |
tree | a715ece05c12fdca76f98e3e3cf669e7489db697 /src/Text/Pandoc/Readers | |
parent | ae8c0cdba82c9cfb847025c3f5ca410407b0fb96 (diff) | |
download | pandoc-95d602d3b7df8946f236aaad310bedf8fdc2e09f.tar.gz |
Docx reader: Parse hyperlinks in instrText tags
This was a form of hyperlink found in older versions of word. The
changes introduced for this, though, create a framework for parsing
further fields in MS Word (see the spec, ECMA-376-1:2016, ยง17.16.5,
for more on these fields).
Closes #3389 and #4266.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Docx.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index 998179d2f..21120824f 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -446,8 +446,10 @@ parPartToInlines' (PlainOMath exps) = return $ math $ writeTeX exps parPartToInlines' (SmartTag runs) = do smushInlines <$> mapM runToInlines runs -parPartToInlines' (Field _ runs) = do - smushInlines <$> mapM runToInlines runs +parPartToInlines' (Field info runs) = do + case info of + HyperlinkField url -> parPartToInlines' $ ExternalHyperLink url runs + UnknownField -> smushInlines <$> mapM runToInlines runs parPartToInlines' NullParPart = return mempty isAnchorSpan :: Inline -> Bool |