aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2023-05-04 11:47:53 +0200
committerAlbert Krewinkel <[email protected]>2023-05-04 11:52:04 +0200
commitf9bbbf6f402edfac34db5482c9c5d9c4f230b875 (patch)
tree46c0cea4701bba38a55d617a2d02d072af1ac710
parent05a23af76d30effa7e40e0346479fb57ed4804d3 (diff)
Markdown reader: disallow escaping of `~` and `"` in markdown_strict
This matches the behavior of the legacy `markdown.pl` as well as what is described in the manual. Fixes: #8777
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs2
-rw-r--r--test/command/8777.md8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index e0c0922cb..6038ecab1 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1556,7 +1556,7 @@ escapedChar' = try $ do
(guardEnabled Ext_all_symbols_escapable >> satisfy (not . isAlphaNum))
<|> (guardEnabled Ext_angle_brackets_escapable >>
oneOf "\\`*_{}[]()>#+-.!~\"<>")
- <|> oneOf "\\`*_{}[]()>#+-.!~\""
+ <|> oneOf "\\`*_{}[]()>#+-.!"
escapedNewline :: PandocMonad m => MarkdownParser m (F Inlines)
escapedNewline = do
diff --git a/test/command/8777.md b/test/command/8777.md
new file mode 100644
index 000000000..56f5db07c
--- /dev/null
+++ b/test/command/8777.md
@@ -0,0 +1,8 @@
+# Backslash escapes in markdown_strict
+
+```
+% pandoc --from=markdown_strict -t html
+These are not escaped: \~ \"
+^D
+<p>These are not escaped: \~ \"</p>
+```