git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: Escape pipe characters when `pipe_tables` enabled.

Closes #3887.

commit5fc4980216bf0a6b425827417655991859cba5ec authorJohn MacFarlane <jgm@berkeley.edu> dateThu 7 Sep 2017, 22:10 (9 years ago) parenta90f131
2 files changed+2−1
src/Text/Pandoc/Writers/Markdown.hs+1 test/command/3497.md+1−1
src/Text/Pandoc/Writers/Markdown.hs+1
@@ -288,6 +288,7 @@ escapeString opts (c:cs) =
288288 | otherwise -> "&gt;" ++ escapeString opts cs
289289 _ | c `elem` ['\\','`','*','_','[',']','#'] ->
290290 '\\':c:escapeString opts cs
291+ '|' | isEnabled Ext_pipe_tables opts -> '\\':'|':escapeString opts cs
291292 '^' | isEnabled Ext_superscript opts -> '\\':'^':escapeString opts cs
292293 '~' | isEnabled Ext_subscript opts -> '\\':'~':escapeString opts cs
293294 '$' | isEnabled Ext_tex_math_dollars opts -> '\\':'$':escapeString opts cs
test/command/3497.md+1−1
@@ -46,6 +46,6 @@ Also escape things that might become line blocks or tables:
4646% pandoc -t markdown
4747\| hi \|
4848^D
49−\| hi |
49+\| hi \|
5050```
5151