aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-09-03 12:52:19 +0200
committerJohn MacFarlane <[email protected]>2025-09-03 12:56:58 +0200
commit037a6e81e20c81b7546524ec4daa97756864979a (patch)
tree523503e43f704e873d7362b615588af16f7a000f /src
parent6727d2d1771c94a2f09f01e74f5d08b9e0a22c42 (diff)
T.P.Citeproc.BibTeX: Protect case in periodical titles.
Thus, for example, `{npj} Quantum Information` should translate as `[npj]{.nocase} Quantum Information`. Closes #11048.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Citeproc/BibTeX.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs
index a5c0e8da3..ba380da3d 100644
--- a/src/Text/Pandoc/Citeproc/BibTeX.hs
+++ b/src/Text/Pandoc/Citeproc/BibTeX.hs
@@ -57,6 +57,7 @@ import Safe (readMay)
import Text.Printf (printf)
import Text.DocLayout (literal, hsep, nest, hang, Doc(..),
braces, ($$), cr)
+
data Variant = Bibtex | Biblatex
deriving (Show, Eq, Ord)
@@ -967,7 +968,7 @@ getField f = do
getPeriodicalTitle :: Text -> Bib Inlines
getPeriodicalTitle f = do
ils <- getField f
- return ils
+ return $ protectCase id ils
protectCase :: (Inlines -> Inlines) -> (Inlines -> Inlines)
protectCase f = Walk.walk unprotect . f . Walk.walk protect