aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2019-11-14 14:28:30 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2019-11-14 14:46:32 +0100
commite43c2e75a1284f464ce1ef9b3b6e12ea2b645f4a (patch)
treeddd0f19717500a734a43549dc10aecbb2e246d09 /src/Text/Pandoc/Writers
parent8ff7fd484f5f89e33a7d1df9d396f11ee1b4a169 (diff)
downloadpandoc-e43c2e75a1284f464ce1ef9b3b6e12ea2b645f4a.tar.gz
RST writer: fix backslash escaping after strings
The check whether a complex inline element following a string must be escaped, now depends on the last character of the string instead of the first. Fixes: #5906
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index b299e6135..4a3b1b066 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -462,7 +462,7 @@ transformInlines = insertBS .
okBeforeComplex Space = True
okBeforeComplex SoftBreak = True
okBeforeComplex LineBreak = True
- okBeforeComplex (Str (T.uncons -> Just (c,_)))
+ okBeforeComplex (Str (T.unsnoc -> Just (_,c)))
= isSpace c || c `elemText` "-:/'\"<([{–—"
okBeforeComplex _ = False
isComplex :: Inline -> Bool
@@ -491,7 +491,7 @@ flatten outer
combineAll = foldl combine []
combine :: [Inline] -> Inline -> [Inline]
- combine f i =
+ combine f i =
case (outer, i) of
-- quotes are not rendered using RST inlines, so we can keep
-- them and they will be readable and parsable