git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: Treat certain environments as inline
8c55b7bJohn MacFarlane
src/Text/Pandoc/Readers/LaTeX.hs+3−1
@@ -1063,7 +1063,9 @@ rawLaTeXBlock = snd <$> try (withRaw (environment <|> blockCommand))
1063
1063
1064rawLaTeXInline :: PandocMonad m => LP m Inline
1064rawLaTeXInline :: PandocMonad m => LP m Inline
1065rawLaTeXInline = do
1065rawLaTeXInline = do
1066− raw <- (snd <$> withRaw inlineCommand) <|> (snd <$> withRaw blockCommand)
1066+ raw <- (snd <$> withRaw inlineCommand)
1067+ <|> (snd <$> withRaw inlineEnvironment)
1068+ <|> (snd <$> withRaw blockCommand)
1067 RawInline "latex" <$> applyMacros' raw
1069 RawInline "latex" <$> applyMacros' raw
1068
1070
1069addImageCaption :: PandocMonad m => Blocks -> LP m Blocks
1071addImageCaption :: PandocMonad m => Blocks -> LP m Blocks
test/command/3309.mdnew file+52
@@ -0,0 +1,52 @@
1+Certain environments should be treated as inline unless they
2+are surrounded by blank lines:
3+
4+```
5+% pandoc -t latex --wrap=preserve
6+Lorem ipsum dolor sit amet,
7+
8+\begin{equation}
9+E = mc^2,
10+\end{equation}
11+
12+consectetur adipiscing elit.
13+^D
14+Lorem ipsum dolor sit amet,
15+
16+\begin{equation}
17+E = mc^2,
18+\end{equation}
19+
20+consectetur adipiscing elit.
21+```
22+
23+```
24+% pandoc -t latex --wrap=preserve
25+Lorem ipsum dolor sit amet,
26+\begin{equation}
27+E = mc^2,
28+\end{equation}
29+consectetur adipiscing elit.
30+^D
31+Lorem ipsum dolor sit amet,
32+\begin{equation}
33+E = mc^2,
34+\end{equation}
35+consectetur adipiscing elit.
36+```
37+
38+```
39+% pandoc -t latex --wrap=preserve
40+The formula
41+\begin{math}
42+x = y
43+\end{math}
44+should be inline.
45+^D
46+The formula
47+\begin{math}
48+x = y
49+\end{math}
50+should be inline.
51+```
52+