diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-05-27 13:53:26 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-05-27 13:53:26 -0700 |
commit | 0661ce699fe83c64dd5a5874e8ab17241b19550c (patch) | |
tree | 304a4f03950987573c51da6cefb88502fb548bde /src/Text/Pandoc/Readers | |
parent | 6972a7dc9158c1d56b2dc9a06f596386f6b30860 (diff) | |
download | pandoc-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.hs | 3 |
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 |