all repos — grayfriday @ 7a97ffe689e803d08c63679c7f878757fbc1e1f8

blackfriday fork with a few changes

testdata/Backslash escapes.html (view raw)

  1<p>These should all get escaped:</p>
  2
  3<p>Backslash: \</p>
  4
  5<p>Backtick: `</p>
  6
  7<p>Asterisk: *</p>
  8
  9<p>Underscore: _</p>
 10
 11<p>Left brace: {</p>
 12
 13<p>Right brace: }</p>
 14
 15<p>Left bracket: [</p>
 16
 17<p>Right bracket: ]</p>
 18
 19<p>Left paren: (</p>
 20
 21<p>Right paren: )</p>
 22
 23<p>Greater-than: &gt;</p>
 24
 25<p>Hash: #</p>
 26
 27<p>Period: .</p>
 28
 29<p>Bang: !</p>
 30
 31<p>Plus: +</p>
 32
 33<p>Minus: -</p>
 34
 35<p>Tilde: ~</p>
 36
 37<p>These should not, because they occur within a code block:</p>
 38
 39<pre><code>Backslash: \\
 40
 41Backtick: \`
 42
 43Asterisk: \*
 44
 45Underscore: \_
 46
 47Left brace: \{
 48
 49Right brace: \}
 50
 51Left bracket: \[
 52
 53Right bracket: \]
 54
 55Left paren: \(
 56
 57Right paren: \)
 58
 59Greater-than: \&gt;
 60
 61Hash: \#
 62
 63Period: \.
 64
 65Bang: \!
 66
 67Plus: \+
 68
 69Minus: \-
 70
 71Tilde: \~
 72</code></pre>
 73
 74<p>Nor should these, which occur in code spans:</p>
 75
 76<p>Backslash: <code>\\</code></p>
 77
 78<p>Backtick: <code>\`</code></p>
 79
 80<p>Asterisk: <code>\*</code></p>
 81
 82<p>Underscore: <code>\_</code></p>
 83
 84<p>Left brace: <code>\{</code></p>
 85
 86<p>Right brace: <code>\}</code></p>
 87
 88<p>Left bracket: <code>\[</code></p>
 89
 90<p>Right bracket: <code>\]</code></p>
 91
 92<p>Left paren: <code>\(</code></p>
 93
 94<p>Right paren: <code>\)</code></p>
 95
 96<p>Greater-than: <code>\&gt;</code></p>
 97
 98<p>Hash: <code>\#</code></p>
 99
100<p>Period: <code>\.</code></p>
101
102<p>Bang: <code>\!</code></p>
103
104<p>Plus: <code>\+</code></p>
105
106<p>Minus: <code>\-</code></p>
107
108<p>Tilde: <code>\~</code></p>
109
110<p>These should get escaped, even though they're matching pairs for
111other Markdown constructs:</p>
112
113<p>*asterisks*</p>
114
115<p>_underscores_</p>
116
117<p>`backticks`</p>
118
119<p>This is a code span with a literal backslash-backtick sequence: <code>\`</code></p>
120
121<p>This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.</p>
122
123<p>This is a tag with backslashes <span attr='\\backslashes\\'>bar</span>.</p>