git.iko.soy/typeable/pandoc
on master help sign in
Slight improvement to last commit.

We now add a space only if there isn't already one. (Some styles add a space at the end of the left-margin div.)

commita331c69b4935b03d42f88f5346b700c795e09346 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 24 Sep 2020, 10:03 (6 years ago) parent810ea6f
1 file changed+4−1
src/Text/Pandoc/Citeproc.hs+4−1
src/Text/Pandoc/Citeproc.hs+4−1
@@ -165,7 +165,10 @@ insertSpace ils =
165165 case Seq.lookup 0 rest of
166166 Just (Span ("",["csl-right-inline"],[]) _) ->
167167 Many $
168− Span ("",["csl-left-margin"],[]) (xs ++ [Space]) Seq.<| rest
168+ Span ("",["csl-left-margin"],[]) (xs ++ case lastMay xs of
169+ Just Space -> []
170+ _ -> [Space])
171+ Seq.<| rest
169172 _ -> ils
170173 _ -> ils
171174