aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-05-27 13:53:26 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-05-27 13:53:26 -0700
commit0661ce699fe83c64dd5a5874e8ab17241b19550c (patch)
tree304a4f03950987573c51da6cefb88502fb548bde /src/Text/Pandoc/Readers
parent6972a7dc9158c1d56b2dc9a06f596386f6b30860 (diff)
downloadpandoc-0661ce699fe83c64dd5a5874e8ab17241b19550c.tar.gz
rebase_relative_paths extension: don't change fragment paths.
We don't want a pure fragment path to be rewritten, since these are used for cross-referencing.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index e5cbadc94..74f2668e4 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1923,7 +1923,8 @@ autoLink = try $ do
rebasePath :: SourcePos -> Text -> Text
rebasePath pos path = do
let fp = sourceName pos
- in if isAbsolute (T.unpack path) || isURI path
+ isFragment = T.take 1 path == "#"
+ in if isFragment || isAbsolute (T.unpack path) || isURI path
then path
else
case takeDirectory fp of