aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-09-24 10:03:04 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-09-24 10:03:04 -0700
commita331c69b4935b03d42f88f5346b700c795e09346 (patch)
tree5cc37e6c1ab9da9172c274944b7fe2308c274f3d /src/Text
parent810ea6fdf831a004da5f4731153ea3ac61af634c (diff)
downloadpandoc-a331c69b4935b03d42f88f5346b700c795e09346.tar.gz
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.)
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Citeproc.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs
index 71331a4a2..66b1cf74f 100644
--- a/src/Text/Pandoc/Citeproc.hs
+++ b/src/Text/Pandoc/Citeproc.hs
@@ -165,7 +165,10 @@ insertSpace ils =
case Seq.lookup 0 rest of
Just (Span ("",["csl-right-inline"],[]) _) ->
Many $
- Span ("",["csl-left-margin"],[]) (xs ++ [Space]) Seq.<| rest
+ Span ("",["csl-left-margin"],[]) (xs ++ case lastMay xs of
+ Just Space -> []
+ _ -> [Space])
+ Seq.<| rest
_ -> ils
_ -> ils