aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-06-28 13:28:02 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-06-28 13:28:02 -0700
commit4262898fe9cc71abecffc1ffa165dd714c04407d (patch)
treeb73adaac1357468bffa940578025ef08509b95c6 /src
parent7ac8fcbcac366639662ca498ebdead949f5faf09 (diff)
downloadpandoc-4262898fe9cc71abecffc1ffa165dd714c04407d.tar.gz
Set proper initial source name in parsing BibTeX.
(For better error messages.)
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Citeproc/BibTeX.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs
index b17240557..1fe4a2730 100644
--- a/src/Text/Pandoc/Citeproc/BibTeX.hs
+++ b/src/Text/Pandoc/Citeproc/BibTeX.hs
@@ -71,9 +71,11 @@ readBibtexString variant locale idpred contents = do
filter (\item -> idpred (identifier item) &&
entryType item /= "xdata"))
(fromMaybe defaultLang $ localeLanguage locale, Map.empty)
- "" (toSources contents) of
+ (initialSourceName sources) sources of
Left err -> Left err
Right xs -> return xs
+ where
+ sources = toSources contents
-- | Write BibTeX or BibLaTeX given given a 'Reference'.
writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)