From afcdcd747ac484a7511e439891b19e0836947df1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Oct 2021 09:47:19 -0700 Subject: Fix more author splitting issues. Ugly without Space element! --- src/Text/Pandoc/Citeproc/BibTeX.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 :) -- cgit v1.2.3