From 8b0519bd3ea618fabfa4349ee78c36e6b5efb76b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 24 Oct 2022 20:24:27 -0700 Subject: ODT writer: further refinement to #3524. Don't alter the link if the path is empty. --- src/Text/Pandoc/Writers/ODT.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3