Muse writer: fix math expansion for more than one expression per paragraph
commit31b4387a6b53fb543fa6139e6174ad2e2c7bb5e9
authorAlexander Krotov <ilabdsf@gmail.com>
dateTue 6 Mar 2018, 12:53 (9 years ago)
parent7d193b2
src/Text/Pandoc/Writers/Muse.hs+1−1
@@ -295,7 +295,7 @@ conditionalEscapeString s =
295295preprocessInlineList :: PandocMonad m
296296 => [Inline]
297297 -> m [Inline]
298−preprocessInlineList (Math t str:xs) = (++ xs) <$> texMathToInlines t str
298+preprocessInlineList (Math t str:xs) = (++) <$> texMathToInlines t str <*> preprocessInlineList xs
299299preprocessInlineList (x:xs) = (x:) <$> preprocessInlineList xs
300300preprocessInlineList [] = return []
301301
test/Tests/Writers/Muse.hs+1
@@ -333,6 +333,7 @@ tests = [ testGroup "block elements"
333333 , "display math" =: displayMath "2^3" =?> "2<sup>3</sup>"
334334 , "multiple letters in inline math" =: math "abc" =?> "<em>abc</em>"
335335 , "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>"
336337 ]
337338 , "raw inline"
338339 =: rawInline "html" "<mark>marked text</mark>"