git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: fix math expansion for more than one expression per paragraph
31b4387Alexander Krotov
src/Text/Pandoc/Writers/Muse.hs+1−1
@@ -295,7 +295,7 @@ conditionalEscapeString s =
295preprocessInlineList :: PandocMonad m
295preprocessInlineList :: PandocMonad m
296 => [Inline]
296 => [Inline]
297 -> m [Inline]
297 -> m [Inline]
298−preprocessInlineList (Math t str:xs) = (++ xs) <$> texMathToInlines t str
298+preprocessInlineList (Math t str:xs) = (++) <$> texMathToInlines t str <*> preprocessInlineList xs
299preprocessInlineList (x:xs) = (x:) <$> preprocessInlineList xs
299preprocessInlineList (x:xs) = (x:) <$> preprocessInlineList xs
300preprocessInlineList [] = return []
300preprocessInlineList [] = return []
301
301
test/Tests/Writers/Muse.hs+1
@@ -333,6 +333,7 @@ tests = [ testGroup "block elements"
333 , "display math" =: displayMath "2^3" =?> "2<sup>3</sup>"
333 , "display math" =: displayMath "2^3" =?> "2<sup>3</sup>"
334 , "multiple letters in inline math" =: math "abc" =?> "<em>abc</em>"
334 , "multiple letters in inline math" =: math "abc" =?> "<em>abc</em>"
335 , "expand math before normalization" =: math "[" <> str "2]" =?> "<verbatim>[2]</verbatim>"
335 , "expand math before normalization" =: math "[" <> str "2]" =?> "<verbatim>[2]</verbatim>"
336+ , "multiple math expressions inside one inline list" =: math "5_4" <> text ", " <> displayMath "3^2" =?> "5<sub>4</sub>, 3<sup>2</sup>"
336 ]
337 ]
337 , "raw inline"
338 , "raw inline"
338 =: rawInline "html" "<mark>marked text</mark>"
339 =: rawInline "html" "<mark>marked text</mark>"