Set proper initial source name in parsing BibTeX.
(For better error messages.)
This commit is contained in:
parent
7ac8fcbcac
commit
4262898fe9
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue