mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 16:35:42 +00:00
Muse writer: don't wrap displayMath into <verse>
<verse> is a block tag and displayMath is an inline element. Writing <verse> around displayMath could result in nested <verse> tags.
This commit is contained in:
@@ -363,11 +363,8 @@ inlineToMuse (Quoted DoubleQuote lst) = do
|
||||
inlineToMuse (Cite _ lst) = inlineListToMuse lst
|
||||
inlineToMuse (Code _ str) = return $
|
||||
"<code>" <> text (substitute "</code>" "<</code><code>/code>" str) <> "</code>"
|
||||
inlineToMuse (Math InlineMath str) =
|
||||
lift (texMathToInlines InlineMath str) >>= inlineListToMuse
|
||||
inlineToMuse (Math DisplayMath str) = do
|
||||
contents <- lift (texMathToInlines DisplayMath str) >>= inlineListToMuse
|
||||
return $ "<verse>" <> contents <> "</verse>" <> blankline
|
||||
inlineToMuse (Math t str) =
|
||||
lift (texMathToInlines t str) >>= inlineListToMuse
|
||||
inlineToMuse (RawInline (Format f) str) =
|
||||
return $ "<literal style=\"" <> text f <> "\">" <> text str <> "</literal>"
|
||||
inlineToMuse LineBreak = return $ "<br>" <> cr
|
||||
|
||||
@@ -330,7 +330,7 @@ tests = [ testGroup "block elements"
|
||||
]
|
||||
, testGroup "math"
|
||||
[ "inline math" =: math "2^3" =?> "2<sup>3</sup>"
|
||||
, "display math" =: displayMath "2^3" =?> "<verse>2<sup>3</sup></verse>"
|
||||
, "display math" =: displayMath "2^3" =?> "2<sup>3</sup>"
|
||||
, "multiple letters in inline math" =: math "abc" =?> "<em>abc</em>"
|
||||
]
|
||||
, "raw inline"
|
||||
|
||||
+1
-1
@@ -520,7 +520,7 @@ Ellipses…and…and….
|
||||
- 223
|
||||
- <em>p</em>-Tree
|
||||
- Here’s some display math:
|
||||
<verse><verbatim>$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$</verbatim></verse>
|
||||
<verbatim>$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$</verbatim>
|
||||
- Here’s one that has a line break in it:
|
||||
<em>α</em> + <em>ω</em> × <em>x</em><sup>2</sup>.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user