aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs2
-rw-r--r--test/Tests/Writers/Muse.hs3
2 files changed, 5 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
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs
index a8ccd6d87..4cb7618f3 100644
--- a/test/Tests/Writers/Muse.hs
+++ b/test/Tests/Writers/Muse.hs
@@ -382,6 +382,9 @@ tests = [ testGroup "block elements"
, "strong empty string" =: strong (str "") =?> "<strong></strong>"
, "strong emphasized empty string" =: strong (emph (str "")) =?> "**<em></em>**"
, "emphasized strong empty string" =: emph (strong (str "")) =?> "*<strong></strong>*"
+ , "emphasized string with space" =: emph (str " ") =?> "<em> </em>"
+ , "emphasized string ending with space" =: emph (str "foo ") =?> "<em>foo </em>"
+ , "emphasized string with tab" =: emph (str "\t") =?> "<em>\t</em>"
, "emphasized space between empty strings" =: emph (str "" <> space <> str "") =?> "<em> </em>"
, "strong" =: strong (text "foo") =?> "**foo**"
, "strong inside word" =: text "foo" <> strong (text "bar") <> text "baz" =?> "foo<strong>bar</strong>baz"