diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-06-30 17:41:25 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-30 17:41:25 +0200 |
commit | e574d50b1cec1a8aea58db70a2c88ad10f1c4cb2 (patch) | |
tree | 4dcfca7aea45fdf30fff4d292b2c5bd649bf5a94 | |
parent | 5e00cf8086e0960e81c31f7cd981ace646623f09 (diff) | |
download | pandoc-e574d50b1cec1a8aea58db70a2c88ad10f1c4cb2.tar.gz |
Markdown writer: Ensure that `+` and `-` are escaped properly...
so they don't cause spurious lists. Previously they were only
if succeeded by a space, not if they were at end of line.
Closes #3773.
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 3 | ||||
-rw-r--r-- | test/command/3773.md | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index b951288bc..1e0d8bde2 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -416,6 +416,9 @@ blockToMarkdown' opts (Plain inlines) = do '+':s:_ | not isPlain && isSpace s -> "\\" <> contents '*':s:_ | not isPlain && isSpace s -> "\\" <> contents '-':s:_ | not isPlain && isSpace s -> "\\" <> contents + '+':[] | not isPlain -> "\\" <> contents + '*':[] | not isPlain -> "\\" <> contents + '-':[] | not isPlain -> "\\" <> contents '|':_ | (isEnabled Ext_line_blocks opts || isEnabled Ext_pipe_tables opts) && isEnabled Ext_all_symbols_escapable opts diff --git a/test/command/3773.md b/test/command/3773.md new file mode 100644 index 000000000..7ee8a3941 --- /dev/null +++ b/test/command/3773.md @@ -0,0 +1,14 @@ +``` +% pandoc -t markdown +A. \# +B. \+ +C. \* +D. o +E. o or \* +^D +A. \# +B. \+ +C. \* +D. o +E. o or \* +``` |