Merge pull request #39 from athom/tilde-escape

allow \~ to escape as ~
pull/78/head
Vytautas Šaltenis 2014-05-03 16:01:58 +03:00
commit f3ab1849e6
3 changed files with 13 additions and 1 deletions

View File

@ -555,7 +555,7 @@ func leftAngle(p *parser, out *bytes.Buffer, data []byte, offset int) int {
}
// '\\' backslash escape
var escapeChars = []byte("\\`*_{}[]()#+-.!:|&<>")
var escapeChars = []byte("\\`*_{}[]()#+-.!:|&<>~")
func escape(p *parser, out *bytes.Buffer, data []byte, offset int) int {
data = data[offset:]

View File

@ -32,6 +32,8 @@
<p>Minus: -</p>
<p>Tilde: ~</p>
<p>These should not, because they occur within a code block:</p>
<pre><code>Backslash: \\
@ -65,6 +67,8 @@ Bang: \!
Plus: \+
Minus: \-
Tilde: \~
</code></pre>
<p>Nor should these, which occur in code spans:</p>
@ -101,6 +105,8 @@ Minus: \-
<p>Minus: <code>\-</code></p>
<p>Tilde: <code>\~</code></p>
<p>These should get escaped, even though they're matching pairs for
other Markdown constructs:</p>

View File

@ -32,6 +32,8 @@ Plus: \+
Minus: \-
Tilde: \~
These should not, because they occur within a code block:
@ -68,6 +70,8 @@ These should not, because they occur within a code block:
Minus: \-
Tilde: \~
Nor should these, which occur in code spans:
@ -103,6 +107,8 @@ Plus: `\+`
Minus: `\-`
Tilde: `\~`
These should get escaped, even though they're matching pairs for
other Markdown constructs: