diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-06-28 13:28:02 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-06-28 13:28:02 -0700 |
commit | 4262898fe9cc71abecffc1ffa165dd714c04407d (patch) | |
tree | b73adaac1357468bffa940578025ef08509b95c6 | |
parent | 7ac8fcbcac366639662ca498ebdead949f5faf09 (diff) | |
download | pandoc-4262898fe9cc71abecffc1ffa165dd714c04407d.tar.gz |
Set proper initial source name in parsing BibTeX.
(For better error messages.)
-rw-r--r-- | src/Text/Pandoc/Citeproc/BibTeX.hs | 4 |
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) |