From 95d602d3b7df8946f236aaad310bedf8fdc2e09f Mon Sep 17 00:00:00 2001
From: Jesse Rosenthal <jrosenthal@jhu.edu>
Date: Tue, 16 Jan 2018 13:15:00 -0500
Subject: Docx reader: Parse hyperlinks in instrText tags
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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.
---
 src/Text/Pandoc/Readers/Docx.hs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src')

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
-- 
cgit v1.2.3