git.iko.soy/typeable/pandoc
on master help sign in
Set proper initial source name in parsing BibTeX.

(For better error messages.)

commit4262898fe9cc71abecffc1ffa165dd714c04407d authorJohn MacFarlane <jgm@berkeley.edu> dateMon 28 Jun 2021, 13:28 (5 years ago) parent7ac8fcb
1 file changed+3−1
src/Text/Pandoc/Citeproc/BibTeX.hs+3−1
src/Text/Pandoc/Citeproc/BibTeX.hs+3−1
@@ -71,9 +71,11 @@ readBibtexString variant locale idpred contents = do
7171 filter (\item -> idpred (identifier item) &&
7272 entryType item /= "xdata"))
7373 (fromMaybe defaultLang $ localeLanguage locale, Map.empty)
74− "" (toSources contents) of
74+ (initialSourceName sources) sources of
7575 Left err -> Left err
7676 Right xs -> return xs
77+ where
78+ sources = toSources contents
7779
7880-- | Write BibTeX or BibLaTeX given given a 'Reference'.
7981writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)