From 2f6a66feb149753e5298e2acb795196f1cc8b821 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 18 Dec 2023 17:44:56 -0800 Subject: Docx reader: fix HYPERLINK with only switch and no argument. The argument can apparently be omitted, and then we just have a fragment URL. Closes #9246. --- src/Text/Pandoc/Readers/Docx/Fields.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/Docx/Fields.hs b/src/Text/Pandoc/Readers/Docx/Fields.hs index 79c4cca3f..08e253ffb 100644 --- a/src/Text/Pandoc/Readers/Docx/Fields.hs +++ b/src/Text/Pandoc/Readers/Docx/Fields.hs @@ -110,7 +110,7 @@ hyperlink = do many space string "HYPERLINK" spaces - farg <- fieldArgument + farg <- option "" $ notFollowedBy (char '\\') *> fieldArgument switches <- spaces *> many hyperlinkSwitch let url = case switches of ("\\l", s) : _ -> farg <> "#" <> s -- cgit v1.2.3