diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-07-29 14:54:25 -0600 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-07-29 14:54:25 -0600 |
commit | f145aea0f9037f9d957d59ed8608401e7219fbf3 (patch) | |
tree | 0c1b679d1e039e1e51e8c2142cfe47ed9b2d031a /src/Text | |
parent | 1f1a30bbf6aa6d1c1dc60ac9d97560346066d02f (diff) | |
download | pandoc-f145aea0f9037f9d957d59ed8608401e7219fbf3.tar.gz |
parseFromString: preserve at least the source directory.
Previously we just set the source name to "chunk" when parsing
from strings, to avoid misleading source positions.
This had the side effect that `rebase_relative_paths` would break
inside sections that were parsed as strings.
So, now we use "ORIGINAL_SOURCE_PATH_chunk" instead of just "chunk".
Closes #7464.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 09445622d..cfda4bad2 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -599,9 +599,9 @@ parseFromString :: Monad m -> ParserT Sources st m r parseFromString parser str = do oldPos <- getPosition - setPosition $ initialPos "chunk" oldInput <- getInput setInput $ toSources str + setPosition $ initialPos $ sourceName oldPos <> "_chunk" result <- parser spaces setInput oldInput |