From 31b4387a6b53fb543fa6139e6174ad2e2c7bb5e9 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 6 Mar 2018 12:53:19 +0300 Subject: Muse writer: fix math expansion for more than one expression per paragraph --- src/Text/Pandoc/Writers/Muse.hs | 2 +- test/Tests/Writers/Muse.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 1f6006b2e..404ebf7bc 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -295,7 +295,7 @@ conditionalEscapeString s = preprocessInlineList :: PandocMonad m => [Inline] -> m [Inline] -preprocessInlineList (Math t str:xs) = (++ xs) <$> texMathToInlines t str +preprocessInlineList (Math t str:xs) = (++) <$> texMathToInlines t str <*> preprocessInlineList xs preprocessInlineList (x:xs) = (x:) <$> preprocessInlineList xs preprocessInlineList [] = return [] diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index df02236ac..7aec8122a 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -333,6 +333,7 @@ tests = [ testGroup "block elements" , "display math" =: displayMath "2^3" =?> "23" , "multiple letters in inline math" =: math "abc" =?> "abc" , "expand math before normalization" =: math "[" <> str "2]" =?> "[2]" + , "multiple math expressions inside one inline list" =: math "5_4" <> text ", " <> displayMath "3^2" =?> "54, 32" ] , "raw inline" =: rawInline "html" "marked text" -- cgit v1.2.3