aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2021-10-04 09:47:19 -0700
committerJohn MacFarlane <[email protected]>2021-10-04 09:47:19 -0700
commitafcdcd747ac484a7511e439891b19e0836947df1 (patch)
tree193d0fee915725963d18273ab45349a24d564d9b
parent97ed04f36f0e82fa68675bbfa1911ca314fa825c (diff)
Fix more author splitting issues.nospace
Ugly without Space element!
-rw-r--r--src/Text/Pandoc/Citeproc/BibTeX.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs
index 7da39fa42..7276499e4 100644
--- a/src/Text/Pandoc/Citeproc/BibTeX.hs
+++ b/src/Text/Pandoc/Citeproc/BibTeX.hs
@@ -1100,8 +1100,12 @@ getLiteralList' f = do
splitByAnd :: [Inline] -> [Inlines]
splitByAnd =
- map B.fromList . splitWhen (== Str " and ") . foldr splitOnAnd []
+ map B.fromList . splitWhen (== Str " and ") . foldr splitOnAnd [] .
+ normalize . map softBreakToSpace
where
+ normalize = B.toList . mconcat . map B.singleton
+ softBreakToSpace SoftBreak = Str " "
+ softBreakToSpace x = x
splitOnAnd (Str t) =
(intersperse (Str " and ") (map Str (T.splitOn " and " t)) ++)
splitOnAnd x = (x :)