git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: ensure blank between raw block and normal content.
88faa45John MacFarlane
src/Text/Pandoc/Writers/Markdown.hs+7
@@ -847,6 +847,13 @@ blockListToMarkdown opts blocks = do
847 Plain ils : fixBlocks bs
847 Plain ils : fixBlocks bs
848 fixBlocks (Plain ils : bs) =
848 fixBlocks (Plain ils : bs) =
849 Para ils : fixBlocks bs
849 Para ils : fixBlocks bs
850+ fixBlocks (r@(RawBlock f raw) : b : bs)
851+ | not (null raw)
852+ , last raw /= '\n' =
853+ case b of
854+ Plain{} -> r : fixBlocks (b:bs)
855+ RawBlock{} -> r : fixBlocks (b:bs)
856+ _ -> RawBlock f (raw ++ "\n") : fixBlocks (b:bs) -- #4629
850 fixBlocks (x : xs) = x : fixBlocks xs
857 fixBlocks (x : xs) = x : fixBlocks xs
851 fixBlocks [] = []
858 fixBlocks [] = []
852 isListBlock (BulletList _) = True
859 isListBlock (BulletList _) = True
test/command/macros.md+4
@@ -4,6 +4,7 @@
4$\my+\my$
4$\my+\my$
5^D
5^D
6\newcommand{\my}{\phi}
6\newcommand{\my}{\phi}
7+
7$\phi+\phi$
8$\phi+\phi$
8```
9```
9
10
@@ -13,6 +14,7 @@ $\phi+\phi$
13$\my+\my$
14$\my+\my$
14^D
15^D
15\newcommand{\my}{\phi}
16\newcommand{\my}{\phi}
17+
16$\my+\my$
18$\my+\my$
17```
19```
18
20
@@ -75,6 +77,7 @@ x &= y\\\end{aligned}\]
75\end{equation}
77\end{equation}
76^D
78^D
77\newcommand{\my}{\phi}
79\newcommand{\my}{\phi}
80+
78\begin{equation}
81\begin{equation}
79\phi+\phi
82\phi+\phi
80\end{equation}
83\end{equation}
@@ -88,6 +91,7 @@ x &= y\\\end{aligned}\]
88\end{equation}
91\end{equation}
89^D
92^D
90\newcommand{\my}{\phi}
93\newcommand{\my}{\phi}
94+
91\begin{equation}
95\begin{equation}
92\my+\my
96\my+\my
93\end{equation}
97\end{equation}
test/writer.markdown+4
@@ -409,6 +409,7 @@ And this is **strong**
409</tr>
409</tr>
410</table>
410</table>
411<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
411<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
412+
412Here's a simple block:
413Here's a simple block:
413
414
414<div>
415<div>
@@ -446,6 +447,7 @@ foo
446This should just be an HTML comment:
447This should just be an HTML comment:
447
448
448<!-- Comment -->
449<!-- Comment -->
450+
449Multiline:
451Multiline:
450
452
451<!--
453<!--
@@ -455,6 +457,7 @@ Blah
455<!--
457<!--
456 This is another comment.
458 This is another comment.
457-->
459-->
460+
458Code block:
461Code block:
459
462
460 <!-- Comment -->
463 <!-- Comment -->
@@ -462,6 +465,7 @@ Code block:
462Just plain comment, with trailing spaces on the line:
465Just plain comment, with trailing spaces on the line:
463
466
464<!-- foo -->
467<!-- foo -->
468+
465Code:
469Code:
466
470
467 <hr />
471 <hr />