git.iko.soy/typeable/pandoc
on master help sign in
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.

commit95d602d3b7df8946f236aaad310bedf8fdc2e09f authorJesse Rosenthal <jrosenthal@jhu.edu> dateTue 16 Jan 2018, 13:15 (9 years ago) parentae8c0cd
1 file changed+4−2
src/Text/Pandoc/Readers/Docx.hs+4−2
src/Text/Pandoc/Readers/Docx.hs+4−2
@@ -446,8 +446,10 @@ parPartToInlines' (PlainOMath exps) =
446446 return $ math $ writeTeX exps
447447parPartToInlines' (SmartTag runs) = do
448448 smushInlines <$> mapM runToInlines runs
449−parPartToInlines' (Field _ runs) = do
450− smushInlines <$> mapM runToInlines runs
449+parPartToInlines' (Field info runs) = do
450+ case info of
451+ HyperlinkField url -> parPartToInlines' $ ExternalHyperLink url runs
452+ UnknownField -> smushInlines <$> mapM runToInlines runs
451453parPartToInlines' NullParPart = return mempty
452454
453455isAnchorSpan :: Inline -> Bool