summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-10-24 20:24:27 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2022-10-24 20:24:27 -0700
commit8b0519bd3ea618fabfa4349ee78c36e6b5efb76b (patch)
tree835c03000db3cfffe4a8657c4b839d1641574726 /src
parent0e85a77f78a53ebd6cbf46252f1dfc31ef475e16 (diff)
ODT writer: further refinement to #3524.
Don't alter the link if the path is empty.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/ODT.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs
index e3f839dd5..17312387d 100644
--- a/src/Text/Pandoc/Writers/ODT.hs
+++ b/src/Text/Pandoc/Writers/ODT.hs
@@ -77,8 +77,9 @@ fixInternalLinks = walk go
go x = x
fixRel uri =
case parseRelativeReference (T.unpack uri) of
- Nothing -> uri
- Just u -> tshow $ u{ uriPath = "../" <> uriPath u }
+ Just u
+ | not (null (uriPath u)) -> tshow $ u{ uriPath = "../" <> uriPath u }
+ _ -> uri
-- | Produce an ODT file from a Pandoc document.
pandocToODT :: PandocMonad m