summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-12-18 17:44:56 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2023-12-18 17:44:56 -0800
commit2f6a66feb149753e5298e2acb795196f1cc8b821 (patch)
treea56d5848a3cc0b221776841f85ce9163096bcd29
parent95432d3f4e14688daba39ea1d65c8e4811f04ae7 (diff)
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.
-rw-r--r--src/Text/Pandoc/Readers/Docx/Fields.hs2
1 files changed, 1 insertions, 1 deletions
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