File: escapes.html

package info (click to toggle)
python-markdown2 2.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,492 kB
  • sloc: python: 6,201; perl: 1,493; php: 865; makefile: 37
file content (59 lines) | stat: -rw-r--r-- 1,648 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<h1>Backslash-escapes: basics</h1>

<p>**don't shout**</p>

<p>*don't emphasize*</p>

<p>_literal underscores_</p>

<p>__more literal underscores__</p>

<h2>This header has trailing hash marks ##</h2>

<h1>Backslash-escapes: links</h1>

<p>This is not a [link](/url/).</p>

<p>This is a link, not an image link: !<a href="/url/">link</a>.</p>

<p>Should this be an <a href="http://autolink\">http://autolink\</a> or not?
I'll ask on markdown-discuss.
I suspect PHP markdown is considering this NOT an autolink.</p>

<p>This is not a [link definition][link1] but <a href="/url/">this is</a>.</p>

<h1>Backslash-escapse: code blocks</h1>

<p>In a code block:</p>

<pre><code>escapes should \*not\* be \_interpreted\_
even \`backticks\`
</code></pre>

<h1>Backslash-escapse: code spans</h1>

<p>Getting backticks and backslash-escapes working correctly with
code spans can be tricky:</p>

<p><code>a normal code span</code></p>

<p><code>need multiple backticks to include a literal ` backtick</code></p>

<p><code>`use a leading space to start a code span with a backtick</code></p>

<p><code>use a trailing space to end a code span with a backtick`</code></p>

<p><code>backslash-escapes \(are\) \*not\* \`interpreted\` in a code span</code></p>

<p>`<code>a code span prefixed with a literal backtick</code></p>

<p>`not a code span`</p>

<p><em>Note A</em>: The <code>(?!`)</code> after the <code>\1</code> group in the
<code>_DoCodeSpans()/_do_code_spans()</code> regex is necessary to ensure that a backtick
doesn't match at the start of the code block (group <code>\2</code>) in an example like
this:</p>

<ul>
<li>`<code>foo</code></li>
</ul>