Set proper initial source name in parsing BibTeX.

(For better error messages.)
This commit is contained in:
John MacFarlane 2021-06-28 13:28:02 -07:00
parent 7ac8fcbcac
commit 4262898fe9

View file

@ -71,9 +71,11 @@ readBibtexString variant locale idpred contents = do
filter (\item -> idpred (identifier item) && filter (\item -> idpred (identifier item) &&
entryType item /= "xdata")) entryType item /= "xdata"))
(fromMaybe defaultLang $ localeLanguage locale, Map.empty) (fromMaybe defaultLang $ localeLanguage locale, Map.empty)
"" (toSources contents) of (initialSourceName sources) sources of
Left err -> Left err Left err -> Left err
Right xs -> return xs Right xs -> return xs
where
sources = toSources contents
-- | Write BibTeX or BibLaTeX given given a 'Reference'. -- | Write BibTeX or BibLaTeX given given a 'Reference'.
writeBibtexString :: WriterOptions -- ^ options (for writing LaTex) writeBibtexString :: WriterOptions -- ^ options (for writing LaTex)