BibTeX.hs (pandoc-2.11.1.1) | : | BibTeX.hs (pandoc-2.11.2) | ||
---|---|---|---|---|
skipping to change at line 54 | skipping to change at line 54 | |||
-- The metadata will contain a `references` field with the | -- The metadata will contain a `references` field with the | |||
-- bibliography entries, and a `nocite` field with the wildcard `[@*]`. | -- bibliography entries, and a `nocite` field with the wildcard `[@*]`. | |||
readBibLaTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc | readBibLaTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc | |||
readBibLaTeX = readBibTeX' BibTeX.Biblatex | readBibLaTeX = readBibTeX' BibTeX.Biblatex | |||
readBibTeX' :: PandocMonad m => Variant -> ReaderOptions -> Text -> m Pandoc | readBibTeX' :: PandocMonad m => Variant -> ReaderOptions -> Text -> m Pandoc | |||
readBibTeX' variant _opts t = do | readBibTeX' variant _opts t = do | |||
lang <- maybe (Lang "en" (Just "US")) parseLang | lang <- maybe (Lang "en" (Just "US")) parseLang | |||
<$> lookupEnv "LANG" | <$> lookupEnv "LANG" | |||
locale <- case getLocale lang of | locale <- case getLocale lang of | |||
Left e -> throwError $ PandocCiteprocError e | Left e -> | |||
case getLocale (Lang "en" (Just "US")) of | ||||
Right l -> return l | ||||
Left _ -> throwError $ PandocCiteprocError e | ||||
Right l -> return l | Right l -> return l | |||
case BibTeX.readBibtexString variant locale (const True) t of | case BibTeX.readBibtexString variant locale (const True) t of | |||
Left e -> throwError $ PandocParsecError t e | Left e -> throwError $ PandocParsecError t e | |||
Right refs -> return $ setMeta "references" | Right refs -> return $ setMeta "references" | |||
(map referenceToMetaValue refs) | (map referenceToMetaValue refs) | |||
. setMeta "nocite" | . setMeta "nocite" | |||
(cite [Citation {citationId = "*" | (cite [Citation {citationId = "*" | |||
, citationPrefix = [] | , citationPrefix = [] | |||
, citationSuffix = [] | , citationSuffix = [] | |||
, citationMode = NormalCitation | , citationMode = NormalCitation | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added |