aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-09-11 11:49:11 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-09-11 11:49:11 +0300
commit165a61095c08794d1639a683f1c6f1a82387c8d5 (patch)
tree79cedf8f5eb22346bb9fb585d3783df3fd6ad384 /src
parentcb28cab489279c48f0afd7113a75ccd96f43eaba (diff)
downloadpandoc-165a61095c08794d1639a683f1c6f1a82387c8d5.tar.gz
Muse writer: check for whitespace in the beginning and end of Str's
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index 262d4fb50..025114a47 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -415,11 +415,13 @@ fixNotes (x:xs) = x : fixNotes xs
startsWithSpace :: [Inline] -> Bool
startsWithSpace (Space:_) = True
startsWithSpace (SoftBreak:_) = True
+startsWithSpace (Str s:_) = stringStartsWithSpace s
startsWithSpace _ = False
endsWithSpace :: [Inline] -> Bool
endsWithSpace [Space] = True
endsWithSpace [SoftBreak] = True
+endsWithSpace [Str s] = stringStartsWithSpace $ reverse s
endsWithSpace (_:xs) = endsWithSpace xs
endsWithSpace [] = False