10246 lines
793 KiB
HTML
10246 lines
793 KiB
HTML
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1:1-4:3" lang="yaml" class="code highlight js-syntax-highlight language-yaml" data-lang-params="frontmatter" v-pre="true"><code><span id="LC1" class="line" lang="yaml"><span class="na">title</span><span class="pi">:</span> <span class="s">GitLab Flavored Markdown (GLFM) Spec</span></span>
|
|||
|
<span id="LC2" class="line" lang="yaml"><span class="na">version</span><span class="pi">:</span> <span class="s">alpha</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h1 data-sourcepos="5:1-5:15" dir="auto">
|
|||
|
<a id="user-content-preliminaries" class="anchor" href="#preliminaries" aria-hidden="true"></a>Preliminaries</h1>
|
|||
|
<h2 data-sourcepos="7:1-7:23" dir="auto">
|
|||
|
<a id="user-content-characters-and-lines" class="anchor" href="#characters-and-lines" aria-hidden="true"></a>Characters and lines</h2>
|
|||
|
<p data-sourcepos="9:1-10:9" dir="auto">Any sequence of [characters] is a valid CommonMark
|
|||
|
document.</p>
|
|||
|
<p data-sourcepos="12:1-15:26" dir="auto">A <a href="@">character</a> is a Unicode code point. Although some
|
|||
|
code points (for example, combining accents) do not correspond to
|
|||
|
characters in an intuitive sense, all code points count as characters
|
|||
|
for purposes of this spec.</p>
|
|||
|
<p data-sourcepos="17:1-19:22" dir="auto">This spec does not specify an encoding; it thinks of lines as composed
|
|||
|
of [characters] rather than bytes. A conforming parser may be limited
|
|||
|
to a certain encoding.</p>
|
|||
|
<p data-sourcepos="21:1-23:50" dir="auto">A <a href="@">line</a> is a sequence of zero or more [characters]
|
|||
|
other than newline (<code>U+000A</code>) or carriage return (<code>U+000D</code>),
|
|||
|
followed by a [line ending] or by the end of file.</p>
|
|||
|
<p data-sourcepos="25:1-27:18" dir="auto">A <a href="@">line ending</a> is a newline (<code>U+000A</code>), a carriage return
|
|||
|
(<code>U+000D</code>) not followed by a newline, or a carriage return and a
|
|||
|
following newline.</p>
|
|||
|
<p data-sourcepos="29:1-30:59" dir="auto">A line containing no characters, or a line containing only spaces
|
|||
|
(<code>U+0020</code>) or tabs (<code>U+0009</code>), is called a <a href="@">blank line</a>.</p>
|
|||
|
<p data-sourcepos="32:1-32:73" dir="auto">The following definitions of character classes will be used in this spec:</p>
|
|||
|
<p data-sourcepos="34:1-36:52" dir="auto">A <a href="@">whitespace character</a> is a space
|
|||
|
(<code>U+0020</code>), tab (<code>U+0009</code>), newline (<code>U+000A</code>), line tabulation (<code>U+000B</code>),
|
|||
|
form feed (<code>U+000C</code>), or carriage return (<code>U+000D</code>).</p>
|
|||
|
<p data-sourcepos="38:1-39:12" dir="auto"><a href="@">Whitespace</a> is a sequence of one or more [whitespace
|
|||
|
characters].</p>
|
|||
|
<p data-sourcepos="41:1-44:11" dir="auto">A <a href="@">Unicode whitespace character</a> is
|
|||
|
any code point in the Unicode <code>Zs</code> general category, or a tab (<code>U+0009</code>),
|
|||
|
carriage return (<code>U+000D</code>), newline (<code>U+000A</code>), or form feed
|
|||
|
(<code>U+000C</code>).</p>
|
|||
|
<p data-sourcepos="46:1-47:40" dir="auto"><a href="@">Unicode whitespace</a> is a sequence of one
|
|||
|
or more [Unicode whitespace characters].</p>
|
|||
|
<p data-sourcepos="49:1-49:25" dir="auto">A <a href="@">space</a> is <code>U+0020</code>.</p>
|
|||
|
<p data-sourcepos="51:1-52:37" dir="auto">A <a href="@">non-whitespace character</a> is any character
|
|||
|
that is not a [whitespace character].</p>
|
|||
|
<p data-sourcepos="54:1-59:38" dir="auto">An <a href="@">ASCII punctuation character</a>
|
|||
|
is <code>!</code>, <code>"</code>, <code>#</code>, <code>$</code>, <code>%</code>, <code>&</code>, <code>'</code>, <code>(</code>, <code>)</code>,
|
|||
|
<code>*</code>, <code>+</code>, <code>,</code>, <code>-</code>, <code>.</code>, <code>/</code> (U+0021–2F),
|
|||
|
<code>:</code>, <code>;</code>, <code><</code>, <code>=</code>, <code>></code>, <code>?</code>, <code>@</code> (U+003A–0040),
|
|||
|
<code>[</code>, <code>\</code>, <code>]</code>, <code>^</code>, <code>_</code>, <code>`</code> (U+005B–0060),
|
|||
|
<code>{</code>, <code>|</code>, <code>}</code>, or <code>~</code> (U+007B–007E).</p>
|
|||
|
<p data-sourcepos="61:1-63:76" dir="auto">A <a href="@">punctuation character</a> is an [ASCII
|
|||
|
punctuation character] or anything in
|
|||
|
the general Unicode categories <code>Pc</code>, <code>Pd</code>, <code>Pe</code>, <code>Pf</code>, <code>Pi</code>, <code>Po</code>, or <code>Ps</code>.</p>
|
|||
|
<h2 data-sourcepos="65:1-65:7" dir="auto">
|
|||
|
<a id="user-content-tabs" class="anchor" href="#tabs" aria-hidden="true"></a>Tabs</h2>
|
|||
|
<p data-sourcepos="67:1-70:16" dir="auto">Tabs in lines are not expanded to [spaces]. However,
|
|||
|
in contexts where whitespace helps to define block structure,
|
|||
|
tabs behave as if they were replaced by spaces with a tab stop
|
|||
|
of 4 characters.</p>
|
|||
|
<p data-sourcepos="72:1-75:8" dir="auto">Thus, for example, a tab can be used instead of four spaces
|
|||
|
in an indented code block. (Note, however, that internal
|
|||
|
tabs are passed through as literal tabs, not expanded to
|
|||
|
spaces.)</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="77:1-79:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">→foo→baz→→bim</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="81:1-84:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo→baz→→bim</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="86:1-88:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> →foo→baz→→bim</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="90:1-93:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo→baz→→bim</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="95:1-98:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> a→a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ὐ→a</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="100:1-104:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>a→a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">ὐ→a</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="106:1-108:38" dir="auto">In the following example, a continuation paragraph of a list
|
|||
|
item is indented with a tab; this has exactly the same effect
|
|||
|
as indentation with four spaces would:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="110:1-114:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">→bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="116:1-123:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="125:1-129:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">→→bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="131:1-139:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code> bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="141:1-148:36" dir="auto">Normally the <code>></code> that begins a block quote may be followed
|
|||
|
optionally by a space, which is not considered part of the
|
|||
|
content. In the following case <code>></code> is followed by a tab,
|
|||
|
which is treated as if it were expanded into three spaces.
|
|||
|
Since one of these spaces is considered part of the
|
|||
|
delimiter, <code>foo</code> is considered to be indented six spaces
|
|||
|
inside the block quote context, so we get an indented
|
|||
|
code block starting with two spaces.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="150:1-152:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>→→foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="154:1-159:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code> foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="161:1-163:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-→→foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="165:1-172:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><pre><code> foo</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="175:1-178:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">→bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="180:1-184:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="186:1-190:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">→ - baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="192:1-204:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>baz</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="206:1-208:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">#→Foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="210:1-212:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="214:1-216:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*→*→*→</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="218:1-220:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="223:1-223:22" dir="auto">
|
|||
|
<a id="user-content-insecure-characters" class="anchor" href="#insecure-characters" aria-hidden="true"></a>Insecure characters</h2>
|
|||
|
<p data-sourcepos="225:1-226:42" dir="auto">For security reasons, the Unicode character <code>U+0000</code> must be replaced
|
|||
|
with the REPLACEMENT CHARACTER (<code>U+FFFD</code>).</p>
|
|||
|
<h1 data-sourcepos="228:1-228:20" dir="auto">
|
|||
|
<a id="user-content-blocks-and-inlines" class="anchor" href="#blocks-and-inlines" aria-hidden="true"></a>Blocks and inlines</h1>
|
|||
|
<p data-sourcepos="230:1-235:54" dir="auto">We can think of a document as a sequence of
|
|||
|
<a href="@">blocks</a>---structural elements like paragraphs, block
|
|||
|
quotations, lists, headings, rules, and code blocks. Some blocks (like
|
|||
|
block quotes and list items) contain other blocks; others (like
|
|||
|
headings and paragraphs) contain <a href="@">inline</a> content---text,
|
|||
|
links, emphasized text, images, code spans, and so on.</p>
|
|||
|
<h2 data-sourcepos="237:1-237:13" dir="auto">
|
|||
|
<a id="user-content-precedence" class="anchor" href="#precedence" aria-hidden="true"></a>Precedence</h2>
|
|||
|
<p data-sourcepos="239:1-241:59" dir="auto">Indicators of block structure always take precedence over indicators
|
|||
|
of inline structure. So, for example, the following is a list with
|
|||
|
two items, not a list with one item containing a code span:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="243:1-246:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- `one</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- two`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="248:1-253:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>`one</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>two`</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="256:1-263:66" dir="auto">This means that parsing can proceed in two steps: first, the block
|
|||
|
structure of the document can be discerned; second, text lines inside
|
|||
|
paragraphs, headings, and other block constructs can be parsed for inline
|
|||
|
structure. The second step requires information about link reference
|
|||
|
definitions that will be available only at the end of the first
|
|||
|
step. Note that the first step requires processing lines in sequence,
|
|||
|
but the second can be parallelized, since the inline parsing of
|
|||
|
one block element does not affect the inline parsing of any other.</p>
|
|||
|
<h2 data-sourcepos="265:1-265:35" dir="auto">
|
|||
|
<a id="user-content-container-blocks-and-leaf-blocks" class="anchor" href="#container-blocks-and-leaf-blocks" aria-hidden="true"></a>Container blocks and leaf blocks</h2>
|
|||
|
<p data-sourcepos="267:1-270:13" dir="auto">We can divide blocks into two types:
|
|||
|
<a href="@">container blocks</a>,
|
|||
|
which can contain other blocks, and <a href="@">leaf blocks</a>,
|
|||
|
which cannot.</p>
|
|||
|
<h1 data-sourcepos="272:1-272:13" dir="auto">
|
|||
|
<a id="user-content-leaf-blocks" class="anchor" href="#leaf-blocks" aria-hidden="true"></a>Leaf blocks</h1>
|
|||
|
<p data-sourcepos="274:1-275:18" dir="auto">This section describes the different kinds of leaf block that make up a
|
|||
|
Markdown document.</p>
|
|||
|
<h2 data-sourcepos="277:1-277:18" dir="auto">
|
|||
|
<a id="user-content-thematic-breaks" class="anchor" href="#thematic-breaks" aria-hidden="true"></a>Thematic breaks</h2>
|
|||
|
<p data-sourcepos="279:1-282:20" dir="auto">A line consisting of 0-3 spaces of indentation, followed by a sequence
|
|||
|
of three or more matching <code>-</code>, <code>_</code>, or <code>*</code> characters, each followed
|
|||
|
optionally by any number of spaces or tabs, forms a
|
|||
|
<a href="@">thematic break</a>.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="284:1-288:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">___</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="290:1-294:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="297:1-297:17" dir="auto">Wrong characters:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="299:1-301:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="303:1-305:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>+++</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="308:1-310:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">===</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="312:1-314:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>===</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="317:1-317:22" dir="auto">Not enough characters:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="319:1-323:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">--</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">**</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="325:1-329:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>--</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">**</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">__</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="332:1-332:39" dir="auto">One to three spaces indent are allowed:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="334:1-338:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ***</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ***</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="340:1-344:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="347:1-347:24" dir="auto">Four spaces is too many:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="349:1-351:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="353:1-356:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>***</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="359:1-362:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="364:1-367:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">***</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="370:1-370:39" dir="auto">More than three characters may be used:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="372:1-374:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_____________________________________</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="376:1-378:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="381:1-381:42" dir="auto">Spaces are allowed between the characters:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="383:1-385:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - - -</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="387:1-389:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="392:1-394:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ** * ** * ** * **</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="396:1-398:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="401:1-403:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - - -</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="405:1-407:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="410:1-410:30" dir="auto">Spaces are allowed at the end:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="412:1-414:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - - - </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="416:1-418:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="421:1-421:51" dir="auto">However, no other characters may occur in the line:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="423:1-429:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_ _ _ _ a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">a------</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">---a---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="431:1-435:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_ _ _ _ a</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>a------</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>---a---</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="438:1-439:33" dir="auto">It is required that all of the [non-whitespace characters] be the same.
|
|||
|
So, this is not a thematic break:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="441:1-443:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> *-*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="445:1-447:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>-</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="450:1-450:56" dir="auto">Thematic breaks do not need blank lines before or after:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="452:1-456:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">***</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">- bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="458:1-466:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="469:1-469:42" dir="auto">Thematic breaks can interrupt a paragraph:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="471:1-475:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">***</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="477:1-481:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="484:1-488:71" dir="auto">If a line of dashes that meets the above conditions for being a
|
|||
|
thematic break could also be interpreted as the underline of a [setext
|
|||
|
heading], the interpretation as a
|
|||
|
[setext heading] takes precedence. Thus, for example,
|
|||
|
this is a setext heading, not a paragraph followed by a thematic break:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="490:1-494:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="496:1-499:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="502:1-503:63" dir="auto">When both a thematic break and a list item are possible
|
|||
|
interpretations of a line, the thematic break takes precedence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="505:1-509:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">* * *</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">* Bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="511:1-519:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>Foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>Bar</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="522:1-522:68" dir="auto">If you want a thematic break in a list item, use a different bullet:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="524:1-527:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- * * *</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="529:1-536:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>Foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="539:1-539:15" dir="auto">
|
|||
|
<a id="user-content-atx-headings" class="anchor" href="#atx-headings" aria-hidden="true"></a>ATX headings</h2>
|
|||
|
<p data-sourcepos="541:1-551:35" dir="auto">An <a href="@">ATX heading</a>
|
|||
|
consists of a string of characters, parsed as inline content, between an
|
|||
|
opening sequence of 1--6 unescaped <code>#</code> characters and an optional
|
|||
|
closing sequence of any number of unescaped <code>#</code> characters.
|
|||
|
The opening sequence of <code>#</code> characters must be followed by a
|
|||
|
[space] or by the end of line. The optional closing sequence of <code>#</code>s must be
|
|||
|
preceded by a [space] and may be followed by spaces only. The opening
|
|||
|
<code>#</code> character may be indented 0-3 spaces. The raw contents of the
|
|||
|
heading are stripped of leading and trailing spaces before being parsed
|
|||
|
as inline content. The heading level is equal to the number of <code>#</code>
|
|||
|
characters in the opening sequence.</p>
|
|||
|
<p data-sourcepos="553:1-553:16" dir="auto">Simple headings:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="555:1-562:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">## foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">### foo</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">#### foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">##### foo</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">###### foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="564:1-571:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo</h1></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>foo</h2></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h3>foo</h3></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><h4>foo</h4></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><h5>foo</h5></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><h6>foo</h6></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="574:1-574:46" dir="auto">More than six <code>#</code> characters is not a heading:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="576:1-578:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">####### foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="580:1-582:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>####### foo</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="585:1-591:9" dir="auto">At least one space is required between the <code>#</code> characters and the
|
|||
|
heading's contents, unless the heading is empty. Note that many
|
|||
|
implementations currently do not require the space. However, the
|
|||
|
space was required by the
|
|||
|
<a href="http://www.aaronsw.com/2002/atx/atx.py" rel="nofollow noreferrer noopener" target="_blank">original ATX implementation</a>,
|
|||
|
and it helps prevent things like the following from being parsed as
|
|||
|
headings:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="593:1-597:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">#5 bolt</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">#hashtag</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="599:1-602:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>#5 bolt</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>#hashtag</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="605:1-605:56" dir="auto">This is not a heading, because the first <code>#</code> is escaped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="607:1-609:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\## foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="611:1-613:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>## foo</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="616:1-616:31" dir="auto">Contents are parsed as inlines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="618:1-620:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo *bar* \*baz\*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="622:1-624:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo <em>bar</em> *baz*</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="627:1-627:71" dir="auto">Leading and trailing [whitespace] is ignored in parsing inline content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="629:1-631:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="633:1-635:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="638:1-638:44" dir="auto">One to three spaces indentation are allowed:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="640:1-644:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ### foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ## foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> # foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="646:1-650:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo</h3></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>foo</h2></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h1>foo</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="653:1-653:25" dir="auto">Four spaces are too much:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="655:1-657:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> # foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="659:1-662:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code># foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="665:1-668:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> # bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="670:1-673:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"># bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="676:1-676:49" dir="auto">A closing sequence of <code>#</code> characters is optional:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="678:1-681:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">## foo ##</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ### bar ###</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="683:1-686:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>foo</h2></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h3>bar</h3></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="689:1-689:55" dir="auto">It need not be the same length as the opening sequence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="691:1-694:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo ##################################</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">##### foo ##</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="696:1-699:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo</h1></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h5>foo</h5></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="702:1-702:46" dir="auto">Spaces are allowed after the closing sequence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="704:1-706:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo ### </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="708:1-710:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo</h3></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="713:1-715:8" dir="auto">A sequence of <code>#</code> characters with anything but [spaces] following it
|
|||
|
is not a closing sequence, but counts as part of the contents of the
|
|||
|
heading:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="717:1-719:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo ### b</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="721:1-723:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo ### b</h3></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="726:1-726:49" dir="auto">The closing sequence must be preceded by a space:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="728:1-730:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo#</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="732:1-734:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo#</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="737:1-738:24" dir="auto">Backslash-escaped <code>#</code> characters do not count as part
|
|||
|
of the closing sequence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="740:1-744:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo \###</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">## foo #\##</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"># foo \#</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="746:1-750:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo ###</h3></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>foo ###</h2></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h1>foo #</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="753:1-754:41" dir="auto">ATX headings need not be separated from surrounding content by blank
|
|||
|
lines, and they can interrupt paragraphs:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="756:1-760:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">## foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">****</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="762:1-766:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>foo</h2></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="769:1-773:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"># baz</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">Bar foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="775:1-779:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo bar</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h1>baz</h1></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>Bar foo</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="782:1-782:26" dir="auto">ATX headings can be empty:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="784:1-788:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">## </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">#</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">### ###</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="790:1-794:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2></h2></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h1></h1></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h3></h3></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="797:1-797:18" dir="auto">
|
|||
|
<a id="user-content-setext-headings" class="anchor" href="#setext-headings" aria-hidden="true"></a>Setext headings</h2>
|
|||
|
<p data-sourcepos="799:1-807:54" dir="auto">A <a href="@">setext heading</a> consists of one or more
|
|||
|
lines of text, each containing at least one [non-whitespace
|
|||
|
character], with no more than 3 spaces indentation, followed by
|
|||
|
a [setext heading underline]. The lines of text must be such
|
|||
|
that, were they not followed by the setext heading underline,
|
|||
|
they would be interpreted as a paragraph: they cannot be
|
|||
|
interpretable as a [code fence], [ATX heading][ATX headings],
|
|||
|
[block quote][block quotes], [thematic break][thematic breaks],
|
|||
|
[list item][list items], or [HTML block][HTML blocks].</p>
|
|||
|
<p data-sourcepos="809:1-814:40" dir="auto">A <a href="@">setext heading underline</a> is a sequence of
|
|||
|
<code>=</code> characters or a sequence of <code>-</code> characters, with no more than 3
|
|||
|
spaces indentation and any number of trailing spaces. If a line
|
|||
|
containing a single <code>-</code> can be interpreted as an
|
|||
|
empty [list items], it should be interpreted this way
|
|||
|
and not as a [setext heading underline].</p>
|
|||
|
<p data-sourcepos="816:1-820:8" dir="auto">The heading is a level 1 heading if <code>=</code> characters are used in
|
|||
|
the [setext heading underline], and a level 2 heading if <code>-</code>
|
|||
|
characters are used. The contents of the heading are the result
|
|||
|
of parsing the preceding lines of text as CommonMark inline
|
|||
|
content.</p>
|
|||
|
<p data-sourcepos="822:1-825:5" dir="auto">In general, a setext heading need not be preceded or followed by a
|
|||
|
blank line. However, it cannot interrupt a paragraph, so when a
|
|||
|
setext heading comes after a paragraph, a blank line is needed between
|
|||
|
them.</p>
|
|||
|
<p data-sourcepos="827:1-827:16" dir="auto">Simple examples:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="829:1-835:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo *bar*</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">=========</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">Foo *bar*</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">---------</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="837:1-840:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo <em>bar</em></h1></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>Foo <em>bar</em></h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="843:1-843:54" dir="auto">The content of the header may span more than one line:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="845:1-849:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo *bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">====</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="851:1-854:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo <em>bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</em></h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="856:1-859:13" dir="auto">The contents are the result of parsing the headings's raw
|
|||
|
content as inlines. The heading's raw content is formed by
|
|||
|
concatenating the lines and removing initial and final
|
|||
|
[whitespace].</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="861:1-865:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo *bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz*→</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">====</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="867:1-870:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo <em>bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</em></h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="873:1-873:34" dir="auto">The underlining can be any length:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="875:1-881:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">-------------------------</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">=</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="883:1-886:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="889:1-890:33" dir="auto">The heading content can be indented up to three spaces, and need
|
|||
|
not line up with the underlining:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="892:1-901:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> Foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">-----</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> Foo</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"> ===</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="903:1-907:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>Foo</h2></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="910:1-910:31" dir="auto">Four spaces indent is too much:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="912:1-918:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ---</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> Foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="920:1-927:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="930:1-931:25" dir="auto">The setext heading underline can be indented up to three spaces, and
|
|||
|
may have trailing spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="933:1-936:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ---- </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="938:1-940:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="943:1-943:24" dir="auto">Four spaces is too much:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="945:1-948:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="950:1-953:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="956:1-956:60" dir="auto">The setext heading underline cannot contain internal spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="958:1-964:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">= =</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">--- -</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="966:1-971:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">= =</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>Foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="974:1-974:62" dir="auto">Trailing spaces in the content line do not cause a line break:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="976:1-979:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">-----</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="981:1-983:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="986:1-986:32" dir="auto">Nor does a backslash at the end:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="988:1-991:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo\</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">----</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="993:1-995:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo\</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="998:1-999:66" dir="auto">Since indicators of block structure take precedence over
|
|||
|
indicators of inline structure, the following are setext headings:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1001:1-1009:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">----</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">`</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><a title="a lot</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">of dashes"/></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1011:1-1016:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>`Foo</h2></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>`</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h2>&lt;a title=&quot;a lot</h2></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>of dashes&quot;/&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1019:1-1020:36" dir="auto">The setext heading underline cannot be a [lazy continuation
|
|||
|
line] in a list item or block quote:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1022:1-1025:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1027:1-1032:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>Foo</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1035:1-1039:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">===</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1041:1-1047:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">===</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1050:1-1053:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1055:1-1060:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>Foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1063:1-1065:25" dir="auto">A blank line is needed between a paragraph and a following
|
|||
|
setext heading, since otherwise the paragraph becomes part
|
|||
|
of the heading's content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1067:1-1071:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">Bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1073:1-1076:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">Bar</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1079:1-1080:16" dir="auto">But in general a blank line is not required before or after
|
|||
|
setext headings:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1082:1-1089:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">Bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">Baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1091:1-1096:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>Foo</h2></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h2>Bar</h2></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>Baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1099:1-1099:32" dir="auto">Setext headings cannot be empty:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1101:1-1104:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">====</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1106:1-1108:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>====</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1111:1-1113:55" dir="auto">Setext heading text lines must not be interpretable as block
|
|||
|
constructs other than paragraphs. So, the line of dashes
|
|||
|
in these examples gets interpreted as a thematic break:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1115:1-1118:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1120:1-1123:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1126:1-1129:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">-----</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1131:1-1136:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1139:1-1142:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1144:1-1148:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1151:1-1154:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">-----</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1156:1-1161:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1164:1-1165:22" dir="auto">If you want a heading with <code>> foo</code> as its literal text, you can
|
|||
|
use backslash escapes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1167:1-1170:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">------</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1172:1-1174:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>&gt; foo</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1177:1-1179:48" dir="auto"><strong>Compatibility note:</strong> Most existing Markdown implementations
|
|||
|
do not allow the text of setext headings to span multiple lines.
|
|||
|
But there is no consensus about how to interpret</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1181:1-1186:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="gh">bar</span></span>
|
|||
|
<span id="LC3" class="line" lang="markdown"><span class="gh">---</span></span>
|
|||
|
<span id="LC4" class="line" lang="markdown">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1188:1-1188:44" dir="auto">One can find four different interpretations:</p>
|
|||
|
<ol data-sourcepos="1190:1-1194:0" dir="auto">
|
|||
|
<li data-sourcepos="1190:1-1190:50">paragraph "Foo", heading "bar", paragraph "baz"</li>
|
|||
|
<li data-sourcepos="1191:1-1191:55">paragraph "Foo bar", thematic break, paragraph "baz"</li>
|
|||
|
<li data-sourcepos="1192:1-1192:30">paragraph "Foo bar --- baz"</li>
|
|||
|
<li data-sourcepos="1193:1-1194:0">heading "Foo bar", paragraph "baz"</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="1195:1-1198:43" dir="auto">We find interpretation 4 most natural, and interpretation 4
|
|||
|
increases the expressive power of CommonMark, by allowing
|
|||
|
multiline headings. Authors who want interpretation 1 can
|
|||
|
put a blank line after the first paragraph:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1200:1-1206:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1208:1-1212:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>bar</h2></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1215:1-1216:19" dir="auto">Authors who want interpretation 2 can put blank lines around
|
|||
|
the thematic break,</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1218:1-1225:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1227:1-1232:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1235:1-1236:19" dir="auto">or use a thematic break that cannot count as a [setext heading
|
|||
|
underline], such as</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1238:1-1243:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">* * *</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1245:1-1250:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1253:1-1253:60" dir="auto">Authors who want interpretation 3 can use backslash escapes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1255:1-1260:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">\---</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1262:1-1267:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="1270:1-1270:23" dir="auto">
|
|||
|
<a id="user-content-indented-code-blocks" class="anchor" href="#indented-code-blocks" aria-hidden="true"></a>Indented code blocks</h2>
|
|||
|
<p data-sourcepos="1272:1-1278:44" dir="auto">An <a href="@">indented code block</a> is composed of one or more
|
|||
|
[indented chunks] separated by blank lines.
|
|||
|
An <a href="@">indented chunk</a> is a sequence of non-blank lines,
|
|||
|
each indented four or more spaces. The contents of the code block are
|
|||
|
the literal contents of the lines, including trailing
|
|||
|
[line endings], minus four spaces of indentation.
|
|||
|
An indented code block has no [info string].</p>
|
|||
|
<p data-sourcepos="1280:1-1283:11" dir="auto">An indented code block cannot interrupt a paragraph, so there must be
|
|||
|
a blank line between a paragraph and a following indented code block.
|
|||
|
(A blank line is not needed, however, between a code block and a following
|
|||
|
paragraph.)</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1285:1-1288:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> a simple</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> indented code block</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1290:1-1294:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>a simple</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> indented code block</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1297:1-1299:65" dir="auto">If there is any ambiguity between an interpretation of indentation
|
|||
|
as a code block and as indicating that material belongs to a [list
|
|||
|
item][list items], the list item interpretation takes precedence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1301:1-1305:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1307:1-1314:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1317:1-1321:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> - bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1323:1-1332:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1336:1-1337:12" dir="auto">The contents of a code block are literal text, and do not get parsed
|
|||
|
as Markdown:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1339:1-1344:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <a/></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> *hi*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> - one</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1346:1-1352:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>&lt;a/&gt;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*hi*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">- one</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1355:1-1355:51" dir="auto">Here we have three chunks separated by blank lines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1357:1-1365:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> chunk1</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> chunk2</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> chunk3</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1367:1-1376:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>chunk1</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">chunk2</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">chunk3</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1379:1-1380:24" dir="auto">Any initial spaces beyond four will be included in the content, even
|
|||
|
in interior blank lines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1382:1-1386:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> chunk1</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> chunk2</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1388:1-1393:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>chunk1</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> chunk2</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1396:1-1397:37" dir="auto">An indented code block cannot interrupt a paragraph. (This
|
|||
|
allows hanging indents and the like.)</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1399:1-1403:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1405:1-1408:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1411:1-1413:20" dir="auto">However, any non-blank line with fewer than four leading spaces ends
|
|||
|
the code block immediately. So a paragraph may occur immediately
|
|||
|
after indented code:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1415:1-1418:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1420:1-1424:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1427:1-1428:7" dir="auto">And indented code can occur immediately before and after other kinds of
|
|||
|
blocks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1430:1-1437:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># Heading</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">Heading</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">------</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">----</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1439:1-1447:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Heading</h1></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><h2>Heading</h2></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><pre><code>foo</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1450:1-1450:53" dir="auto">The first line can be indented more than four spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1452:1-1455:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1457:1-1461:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1464:1-1465:23" dir="auto">Blank lines preceding or following an indented code block
|
|||
|
are not included in it:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1467:1-1473:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1475:1-1478:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1481:1-1481:57" dir="auto">Trailing spaces are included in the code block's content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1483:1-1485:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1487:1-1490:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="1494:1-1494:21" dir="auto">
|
|||
|
<a id="user-content-fenced-code-blocks" class="anchor" href="#fenced-code-blocks" aria-hidden="true"></a>Fenced code blocks</h2>
|
|||
|
<p data-sourcepos="1496:1-1500:61" dir="auto">A <a href="@">code fence</a> is a sequence
|
|||
|
of at least three consecutive backtick characters (<code>`</code>) or
|
|||
|
tildes (<code>~</code>). (Tildes and backticks cannot be mixed.)
|
|||
|
A <a href="@">fenced code block</a>
|
|||
|
begins with a code fence, indented no more than three spaces.</p>
|
|||
|
<p data-sourcepos="1502:1-1508:34" dir="auto">The line with the opening code fence may optionally contain some text
|
|||
|
following the code fence; this is trimmed of leading and trailing
|
|||
|
whitespace and called the <a href="@">info string</a>. If the [info string] comes
|
|||
|
after a backtick fence, it may not contain any backtick
|
|||
|
characters. (The reason for this restriction is that otherwise
|
|||
|
some inline code would be incorrectly interpreted as the
|
|||
|
beginning of a fenced code block.)</p>
|
|||
|
<p data-sourcepos="1510:1-1517:43" dir="auto">The content of the code block consists of all subsequent lines, until
|
|||
|
a closing [code fence] of the same type as the code block
|
|||
|
began with (backticks or tildes), and with at least as many backticks
|
|||
|
or tildes as the opening code fence. If the leading code fence is
|
|||
|
indented N spaces, then up to N spaces of indentation are removed from
|
|||
|
each line of the content (if present). (If a content line is not
|
|||
|
indented, it is preserved unchanged. If it is indented less than N
|
|||
|
spaces, all of the indentation is removed.)</p>
|
|||
|
<p data-sourcepos="1519:1-1527:25" dir="auto">The closing code fence may be indented up to three spaces, and may be
|
|||
|
followed only by spaces, which are ignored. If the end of the
|
|||
|
containing block (or document) is reached and no closing code fence
|
|||
|
has been found, the code block contains all of the lines after the
|
|||
|
opening code fence until the end of the containing block (or
|
|||
|
document). (An alternative spec would require backtracking in the
|
|||
|
event that a closing code fence is not found. But this makes parsing
|
|||
|
much less efficient, and there seems to be no real down side to the
|
|||
|
behavior described here.)</p>
|
|||
|
<p data-sourcepos="1529:1-1530:36" dir="auto">A fenced code block may interrupt a paragraph, and does not require
|
|||
|
a blank line either before or after.</p>
|
|||
|
<p data-sourcepos="1532:1-1536:42" dir="auto">The content of a code fence is treated as literal text, not parsed
|
|||
|
as inlines. The first word of the [info string] is typically used to
|
|||
|
specify the language of the code sample, and rendered in the <code>class</code>
|
|||
|
attribute of the <code>code</code> tag. However, this spec does not mandate any
|
|||
|
particular treatment of the [info string].</p>
|
|||
|
<p data-sourcepos="1538:1-1538:40" dir="auto">Here is a simple example with backticks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1540:1-1545:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1547:1-1551:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>&lt;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> &gt;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1554:1-1554:12" dir="auto">With tildes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1556:1-1561:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">~~~</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1563:1-1567:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>&lt;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> &gt;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1569:1-1569:41" dir="auto">Fewer than three backticks is not enough:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1571:1-1575:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">``</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1577:1-1579:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1581:1-1582:6" dir="auto">The closing code fence must use the same character as the opening
|
|||
|
fence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1584:1-1589:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1591:1-1595:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1598:1-1603:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">~~~</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1605:1-1609:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1612:1-1612:69" dir="auto">The closing code fence must be at least as long as the opening fence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1614:1-1619:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">````</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">``````</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1621:1-1625:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1628:1-1633:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">~~~~</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1635:1-1639:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1642:1-1643:74" dir="auto">Unclosed code blocks are closed by the end of the document
|
|||
|
(or the enclosing [block quote][block quotes] or [list item][list items]):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1645:1-1647:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1649:1-1651:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1654:1-1659:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`````</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">aaa</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1661:1-1666:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1669:1-1674:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">bbb</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1676:1-1682:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>bbb</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1685:1-1685:53" dir="auto">A code block can have all empty lines as its content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1687:1-1692:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1694:1-1698:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1701:1-1701:26" dir="auto">A code block can be empty:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1703:1-1706:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1708:1-1710:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1713:1-1715:11" dir="auto">Fences can be indented. If the opening fence is indented,
|
|||
|
content lines will have equivalent opening indentation removed,
|
|||
|
if present:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1717:1-1722:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1724:1-1728:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1731:1-1737:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> ```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1739:1-1744:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1747:1-1753:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> ```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1755:1-1760:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1763:1-1763:56" dir="auto">Four spaces indentation produces an indented code block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1765:1-1769:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1771:1-1776:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1779:1-1780:41" dir="auto">Closing fences may be indented by 0-3 spaces, and their indentation
|
|||
|
need not match that of the opening fence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1782:1-1786:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1788:1-1791:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1794:1-1798:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1800:1-1803:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1806:1-1806:61" dir="auto">This is not a closing fence, because it is indented 4 spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1808:1-1812:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1814:1-1818:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1822:1-1822:65" dir="auto">Code fences (opening and closing) cannot contain internal spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1824:1-1827:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1829:1-1832:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> </code></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1835:1-1839:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~~~</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">~~~ ~~</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1841:1-1845:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">~~~ ~~</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1848:1-1849:53" dir="auto">Fenced code blocks can interrupt paragraphs, and can be followed
|
|||
|
directly by paragraphs, without a blank line between:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1851:1-1857:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1859:1-1864:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code>bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1867:1-1868:34" dir="auto">Other blocks can also occur before and after fenced code blocks
|
|||
|
without an intervening blank line:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1870:1-1877:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"># baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1879:1-1884:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>foo</h2></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code>bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><h1>baz</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1887:1-1892:45" dir="auto">An [info string] can be provided after the opening code fence.
|
|||
|
Although this spec doesn't mandate any particular treatment of
|
|||
|
the info string, the first word is typically used to specify
|
|||
|
the language of the code block. In HTML output, the language is
|
|||
|
normally indicated by adding a class to the <code>code</code> element consisting
|
|||
|
of <code>language-</code> followed by the language name.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1894:1-1900:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```ruby</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">def foo(x)</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> return 3</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">end</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1902:1-1907:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-ruby">def foo(x)</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> return 3</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">end</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1910:1-1916:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~ ruby startline=3 $%@#$</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">def foo(x)</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> return 3</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">end</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">~~~~~~~</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1918:1-1923:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-ruby">def foo(x)</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> return 3</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">end</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1926:1-1929:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">````;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">````</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1931:1-1933:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-;"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1936:1-1936:65" dir="auto">[Info strings] for backtick code blocks cannot contain backticks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1938:1-1941:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` aa ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1943:1-1946:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>aa</code></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1949:1-1949:70" dir="auto">[Info strings] for tilde code blocks can contain backticks and tildes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1951:1-1955:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~ aa ``` ~~~</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">~~~</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1957:1-1960:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-aa">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="1963:1-1963:47" dir="auto">Closing code fences cannot have [info strings]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1965:1-1969:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">``` aaa</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="1971:1-1974:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>``` aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="1978:1-1978:14" dir="auto">
|
|||
|
<a id="user-content-html-blocks" class="anchor" href="#html-blocks" aria-hidden="true"></a>HTML blocks</h2>
|
|||
|
<p data-sourcepos="1980:1-1981:53" dir="auto">An <a href="@">HTML block</a> is a group of lines that is treated
|
|||
|
as raw HTML (and will not be escaped in HTML output).</p>
|
|||
|
<p data-sourcepos="1983:1-1991:50" dir="auto">There are seven kinds of [HTML block], which can be defined by their
|
|||
|
start and end conditions. The block begins with a line that meets a
|
|||
|
<a href="@">start condition</a> (after up to three spaces optional indentation).
|
|||
|
It ends with the first subsequent line that meets a matching <a href="@">end
|
|||
|
condition</a>, or the last line of the document, or the last line of
|
|||
|
the <a href="#container-blocks">container block</a> containing the current HTML
|
|||
|
block, if no line is encountered that meets the [end condition]. If
|
|||
|
the first line meets both the [start condition] and the [end
|
|||
|
condition], the block will contain just that line.</p>
|
|||
|
<ol data-sourcepos="1993:1-2034:0" dir="auto">
|
|||
|
<li data-sourcepos="1993:1-1999:0">
|
|||
|
<p data-sourcepos="1993:5-1998:30"><strong>Start condition:</strong> line begins with the string <code><script</code>,
|
|||
|
<code><pre</code>, or <code><style</code> (case-insensitive), followed by whitespace,
|
|||
|
the string <code>></code>, or the end of the line.<br>
|
|||
|
<strong>End condition:</strong> line contains an end tag
|
|||
|
<code></script></code>, <code></pre></code>, or <code></style></code> (case-insensitive; it
|
|||
|
need not match the start tag).</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="2000:1-2002:0">
|
|||
|
<p data-sourcepos="2000:5-2001:51"><strong>Start condition:</strong> line begins with the string <code><!--</code>.<br>
|
|||
|
<strong>End condition:</strong> line contains the string <code>--></code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="2003:1-2005:0">
|
|||
|
<p data-sourcepos="2003:5-2004:49"><strong>Start condition:</strong> line begins with the string <code><?</code>.<br>
|
|||
|
<strong>End condition:</strong> line contains the string <code>?></code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="2006:1-2009:0">
|
|||
|
<p data-sourcepos="2006:5-2008:51"><strong>Start condition:</strong> line begins with the string <code><!</code>
|
|||
|
followed by an uppercase ASCII letter.<br>
|
|||
|
<strong>End condition:</strong> line contains the character <code>></code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="2010:1-2013:0">
|
|||
|
<p data-sourcepos="2010:5-2012:50"><strong>Start condition:</strong> line begins with the string
|
|||
|
<code><![CDATA[</code>.<br>
|
|||
|
<strong>End condition:</strong> line contains the string <code>]]></code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="2014:1-2028:0">
|
|||
|
<p data-sourcepos="2014:5-2027:54"><strong>Start condition:</strong> line begins the string <code><</code> or <code></</code>
|
|||
|
followed by one of the strings (case-insensitive) <code>address</code>,
|
|||
|
<code>article</code>, <code>aside</code>, <code>base</code>, <code>basefont</code>, <code>blockquote</code>, <code>body</code>,
|
|||
|
<code>caption</code>, <code>center</code>, <code>col</code>, <code>colgroup</code>, <code>dd</code>, <code>details</code>, <code>dialog</code>,
|
|||
|
<code>dir</code>, <code>div</code>, <code>dl</code>, <code>dt</code>, <code>fieldset</code>, <code>figcaption</code>, <code>figure</code>,
|
|||
|
<code>footer</code>, <code>form</code>, <code>frame</code>, <code>frameset</code>,
|
|||
|
<code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code>, <code>head</code>, <code>header</code>, <code>hr</code>,
|
|||
|
<code>html</code>, <code>iframe</code>, <code>legend</code>, <code>li</code>, <code>link</code>, <code>main</code>, <code>menu</code>, <code>menuitem</code>,
|
|||
|
<code>nav</code>, <code>noframes</code>, <code>ol</code>, <code>optgroup</code>, <code>option</code>, <code>p</code>, <code>param</code>,
|
|||
|
<code>section</code>, <code>summary</code>, <code>table</code>, <code>tbody</code>, <code>td</code>,
|
|||
|
<code>tfoot</code>, <code>th</code>, <code>thead</code>, <code>title</code>, <code>tr</code>, <code>track</code>, <code>ul</code>, followed
|
|||
|
by [whitespace], the end of the line, the string <code>></code>, or
|
|||
|
the string <code>/></code>.<br>
|
|||
|
<strong>End condition:</strong> line is followed by a [blank line].</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="2029:1-2034:0">
|
|||
|
<p data-sourcepos="2029:5-2033:54"><strong>Start condition:</strong> line begins with a complete [open tag]
|
|||
|
(with any [tag name] other than <code>script</code>,
|
|||
|
<code>style</code>, or <code>pre</code>) or a complete [closing tag],
|
|||
|
followed only by [whitespace] or the end of the line.<br>
|
|||
|
<strong>End condition:</strong> line is followed by a [blank line].</p>
|
|||
|
</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="2035:1-2040:19" dir="auto">HTML blocks continue until they are closed by their appropriate
|
|||
|
[end condition], or the last line of the document or other <a href="#container-blocks">container
|
|||
|
block</a>. This means any HTML <strong>within an HTML
|
|||
|
block</strong> that might otherwise be recognised as a start condition will
|
|||
|
be ignored by the parser and passed through as-is, without changing
|
|||
|
the parser's state.</p>
|
|||
|
<p data-sourcepos="2042:1-2044:51" dir="auto">For instance, <code><pre></code> within a HTML block started by <code><table></code> will not affect
|
|||
|
the parser state; as the HTML block was started in by start condition 6, it
|
|||
|
will end at any blank line. This can be surprising:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2046:1-2054:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">**Hello**,</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">_world_.</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></td></tr></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2056:1-2063:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">**Hello**,</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p><em>world</em>.</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></pre></p></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></td></tr></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2065:1-2067:55" dir="auto">In this case, the HTML block is terminated by the newline — the <code>**Hello**</code>
|
|||
|
text remains verbatim — and regular parsing resumes, with a paragraph,
|
|||
|
emphasised <code>world</code> and inline and block HTML following.</p>
|
|||
|
<p data-sourcepos="2069:1-2072:65" dir="auto">All types of [HTML blocks] except type 7 may interrupt
|
|||
|
a paragraph. Blocks of type 7 may not interrupt a paragraph.
|
|||
|
(This restriction is intended to prevent unwanted interpretation
|
|||
|
of long tags inside a wrapped paragraph as starting HTML blocks.)</p>
|
|||
|
<p data-sourcepos="2074:1-2075:10" dir="auto">Some simple examples follow. Here are some basic HTML blocks
|
|||
|
of type 6:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2077:1-2087:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> <tr></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <td></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> hi</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> </td></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> </tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></table></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext">okay.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2089:1-2098:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> <tr></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <td></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> hi</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> </td></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> </tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></table></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><p>okay.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2101:1-2105:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> *hello*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <foo><a></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2107:1-2111:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> *hello*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <foo><a></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2114:1-2114:42" dir="auto">A block can also start with a closing tag:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2116:1-2119:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2121:1-2124:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2127:1-2127:68" dir="auto">Here we have two HTML blocks with a Markdown paragraph between them:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2129:1-2135:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><DIV CLASS="foo"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">*Markdown*</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></DIV></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2137:1-2141:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><DIV CLASS="foo"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><em>Markdown</em></p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></DIV></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2144:1-2145:47" dir="auto">The tag on the first line can be partial, as long
|
|||
|
as it is split where there would be whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2147:1-2151:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> class="bar"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2153:1-2157:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> class="bar"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2160:1-2164:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo" class="bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> baz"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2166:1-2170:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo" class="bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> baz"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2173:1-2173:31" dir="auto">An open tag need not be closed:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2174:1-2179:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">*bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2181:1-2185:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p><em>bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2189:1-2190:17" dir="auto">A partial tag need not even be completed (garbage
|
|||
|
in, garbage out):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2192:1-2195:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*hi*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2197:1-2200:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*hi*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2203:1-2206:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div class</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2208:1-2211:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div class</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2214:1-2215:35" dir="auto">The initial tag doesn't even need to be a valid
|
|||
|
tag, as long as it starts like one:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2217:1-2220:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div *???-&&&-<---</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2222:1-2225:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div *???-&&&-<---</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2228:1-2229:7" dir="auto">In type 6 blocks, the initial tag need not be on a line by
|
|||
|
itself:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2231:1-2233:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div><a href="bar">*foo*</a></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2235:1-2237:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div><a href="bar">*foo*</a></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2240:1-2244:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></td></tr></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2246:1-2250:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></td></tr></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2253:1-2257:43" dir="auto">Everything until the next blank line or end of document
|
|||
|
gets included in the HTML block. So, in the following
|
|||
|
example, what looks like a Markdown code block
|
|||
|
is actually part of the HTML block, which continues until a blank
|
|||
|
line or the end of the document is reached:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2259:1-2264:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">``` c</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">int x = 33;</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2266:1-2271:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">``` c</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">int x = 33;</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2274:1-2276:51" dir="auto">To start an [HTML block] with a tag that is <em>not</em> in the
|
|||
|
list of block-level tags in (6), you must put the tag by
|
|||
|
itself on the first line (and it must be complete):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2278:1-2282:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*bar*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></a></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2284:1-2288:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*bar*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></a></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2291:1-2291:49" dir="auto">In type 7 blocks, the [tag name] can be anything:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2293:1-2297:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><Warning></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*bar*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></Warning></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2299:1-2303:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><Warning></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*bar*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></Warning></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2306:1-2310:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><i class="foo"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*bar*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></i></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2312:1-2316:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><i class="foo"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*bar*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></i></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2319:1-2322:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></ins></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2324:1-2327:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></ins></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2330:1-2334:59" dir="auto">These rules are designed to allow us to work with tags that
|
|||
|
can function as either block-level or inline-level tags.
|
|||
|
The <code><del></code> tag is a nice example. We can surround content with
|
|||
|
<code><del></code> tags in three different ways. In this case, we get a raw
|
|||
|
HTML block, because the <code><del></code> tag is on a line by itself:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2336:1-2340:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></del></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2342:1-2346:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></del></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2349:1-2351:54" dir="auto">In this case, we get a raw HTML block that just includes
|
|||
|
the <code><del></code> tag (because it ends with the following blank
|
|||
|
line). So the contents get interpreted as CommonMark:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2353:1-2359:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">*foo*</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></del></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2361:1-2365:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><em>foo</em></p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></del></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2368:1-2371:29" dir="auto">Finally, in this case, the <code><del></code> tags are interpreted
|
|||
|
as [raw HTML] <em>inside</em> the CommonMark paragraph. (Because
|
|||
|
the tag is not on a line by itself, we get inline HTML
|
|||
|
rather than an [HTML block].)</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2373:1-2375:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del>*foo*</del></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2377:1-2379:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><del><em>foo</em></del></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2382:1-2387:50" dir="auto">HTML tags designed to contain literal content
|
|||
|
(<code>script</code>, <code>style</code>, <code>pre</code>), comments, processing instructions,
|
|||
|
and declarations are treated somewhat differently.
|
|||
|
Instead of ending at the first blank line, these blocks
|
|||
|
end at the first line containing a corresponding end tag.
|
|||
|
As a result, these blocks can contain blank lines:</p>
|
|||
|
<p data-sourcepos="2389:1-2389:19" dir="auto">A pre tag (type 1):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2391:1-2399:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre language="haskell"><code></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">import Text.HTML.TagSoup</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">main :: IO ()</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">main = print $ parseTags tags</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">okay</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2401:1-2409:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre language="haskell"><code></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">import Text.HTML.TagSoup</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">main :: IO ()</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">main = print $ parseTags tags</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><p>okay</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2412:1-2412:22" dir="auto">A script tag (type 1):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2414:1-2421:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script type="text/javascript"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">// JavaScript example</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">document.getElementById("demo").innerHTML = "Hello JavaScript!";</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></script></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">okay</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2423:1-2430:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script type="text/javascript"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">// JavaScript example</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">document.getElementById("demo").innerHTML = "Hello JavaScript!";</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></script></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>okay</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2433:1-2433:21" dir="auto">A style tag (type 1):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2435:1-2443:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> type="text/css"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">h1 {color:red;}</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">p {color:blue;}</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></style></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">okay</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2445:1-2453:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> type="text/css"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">h1 {color:red;}</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">p {color:blue;}</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></style></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><p>okay</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2456:1-2458:28" dir="auto">If there is no matching end tag, the block will end at the
|
|||
|
end of the document (or the enclosing [block quote][block quotes]
|
|||
|
or [list item][list items]):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2460:1-2465:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> type="text/css"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2467:1-2472:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> type="text/css"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2475:1-2480:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> <div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2482:1-2488:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2491:1-2494:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- <div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2496:1-2503:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2506:1-2506:56" dir="auto">The end tag can occur on the same line as the start tag:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2508:1-2511:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style>p{color:red;}</style></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2513:1-2516:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style>p{color:red;}</style></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><em>foo</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2519:1-2522:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- foo -->*bar*</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*baz*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2524:1-2527:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- foo -->*bar*</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><em>baz</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2530:1-2531:45" dir="auto">Note that anything on the last line after the
|
|||
|
end tag will be included in the [HTML block]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2533:1-2537:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></script>1. *bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2539:1-2543:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></script>1. *bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2546:1-2546:19" dir="auto">A comment (type 2):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2548:1-2554:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> baz --></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">okay</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2556:1-2562:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> baz --></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>okay</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2566:1-2566:34" dir="auto">A processing instruction (type 3):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2568:1-2575:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><?php</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> echo '>';</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">?></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">okay</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2577:1-2584:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><?php</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> echo '>';</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">?></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>okay</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2587:1-2587:23" dir="auto">A declaration (type 4):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2589:1-2591:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!DOCTYPE html></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2593:1-2595:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!DOCTYPE html></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2598:1-2598:15" dir="auto">CDATA (type 5):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2600:1-2614:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><![CDATA[</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">function matchwo(a,b)</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">{</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> if (a < b && a < 0) then {</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> return 1;</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> } else {</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"> return 0;</span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"> }</span>
|
|||
|
<span id="LC11" class="line" lang="plaintext">}</span>
|
|||
|
<span id="LC12" class="line" lang="plaintext">]]></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext">okay</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2616:1-2630:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><![CDATA[</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">function matchwo(a,b)</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">{</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> if (a < b && a < 0) then {</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> return 1;</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> } else {</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"> return 0;</span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"> }</span>
|
|||
|
<span id="LC11" class="line" lang="plaintext">}</span>
|
|||
|
<span id="LC12" class="line" lang="plaintext">]]></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"><p>okay</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2633:1-2633:54" dir="auto">The opening tag can be indented 1-3 spaces, but not 4:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2635:1-2639:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <!-- foo --></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <!-- foo --></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2641:1-2645:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <!-- foo --></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code>&lt;!-- foo --&gt;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2648:1-2652:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2654:1-2658:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code>&lt;div&gt;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2661:1-2662:25" dir="auto">An HTML block of types 1--6 can interrupt a paragraph, and need not be
|
|||
|
preceded by a blank line.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2664:1-2669:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2671:1-2676:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2679:1-2681:7" dir="auto">However, a following blank line is needed, except at the end of
|
|||
|
a document, and except for blocks of types 1--5, [above][HTML
|
|||
|
block]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2683:1-2688:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">*foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2690:1-2695:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">*foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2698:1-2698:51" dir="auto">HTML blocks of type 7 cannot interrupt a paragraph:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2700:1-2704:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><a href="bar"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2706:1-2710:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><a href="bar"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2713:1-2714:26" dir="auto">This rule differs from John Gruber's original Markdown syntax
|
|||
|
specification, which says:</p>
|
|||
|
<blockquote data-sourcepos="2716:1-2719:51" dir="auto">
|
|||
|
<p data-sourcepos="2716:3-2719:51">The only restrictions are that block-level HTML elements —
|
|||
|
e.g. <code><div></code>, <code><table></code>, <code><pre></code>, <code><p></code>, etc. — must be separated from
|
|||
|
surrounding content by blank lines, and the start and end tags of the
|
|||
|
block should not be indented with tabs or spaces.</p>
|
|||
|
</blockquote>
|
|||
|
<p data-sourcepos="2721:1-2722:5" dir="auto">In some ways Gruber's rule is more restrictive than the one given
|
|||
|
here:</p>
|
|||
|
<ul data-sourcepos="2724:1-2728:0" dir="auto">
|
|||
|
<li data-sourcepos="2724:1-2724:61">It requires that an HTML block be preceded by a blank line.</li>
|
|||
|
<li data-sourcepos="2725:1-2725:49">It does not allow the start tag to be indented.</li>
|
|||
|
<li data-sourcepos="2726:1-2728:0">It requires a matching end tag, which it also does not allow to
|
|||
|
be indented.</li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="2729:1-2730:34" dir="auto">Most Markdown implementations (including some of Gruber's own) do not
|
|||
|
respect all of these restrictions.</p>
|
|||
|
<p data-sourcepos="2732:1-2739:61" dir="auto">There is one respect, however, in which Gruber's rule is more liberal
|
|||
|
than the one given here, since it allows blank lines to occur inside
|
|||
|
an HTML block. There are two reasons for disallowing them here.
|
|||
|
First, it removes the need to parse balanced tags, which is
|
|||
|
expensive and can require backtracking from the end of the document
|
|||
|
if no matching end tag is found. Second, it provides a very simple
|
|||
|
and flexible way of including Markdown content inside HTML tags:
|
|||
|
simply separate the Markdown from the HTML using blank lines:</p>
|
|||
|
<p data-sourcepos="2741:1-2741:8" dir="auto">Compare:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2743:1-2749:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">*Emphasized* text.</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2751:1-2755:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><em>Emphasized</em> text.</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2758:1-2762:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*Emphasized* text.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2764:1-2768:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*Emphasized* text.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></div></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2771:1-2775:22" dir="auto">Some Markdown implementations have adopted a convention of
|
|||
|
interpreting content inside tags as text if the open tag has
|
|||
|
the attribute <code>markdown=1</code>. The rule given above seems a simpler and
|
|||
|
more elegant way of achieving the same expressive power, which is also
|
|||
|
much simpler to parse.</p>
|
|||
|
<p data-sourcepos="2777:1-2780:59" dir="auto">The main potential drawback is that one can no longer paste HTML
|
|||
|
blocks into Markdown documents with 100% reliability. However,
|
|||
|
<em>in most cases</em> this will work fine, because the blank lines in
|
|||
|
HTML are usually followed by HTML block tags. For example:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2782:1-2794:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><td></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">Hi</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></td></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2796:1-2804:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><td></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">Hi</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></td></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2807:1-2809:23" dir="auto">There are problems, however, if the inner tags are indented
|
|||
|
<em>and</em> separated by spaces, as then they will be interpreted as
|
|||
|
an indented code block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2811:1-2823:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> <td></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> Hi</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> </td></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"> </tr></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2825:1-2834:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> <tr></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><pre><code>&lt;td&gt;</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> Hi</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">&lt;/td&gt;</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> </tr></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2837:1-2840:26" dir="auto">Fortunately, blank lines are usually not necessary and can be
|
|||
|
deleted. The exception is inside <code><pre></code> tags, but as described
|
|||
|
[above][HTML blocks], raw HTML blocks starting with <code><pre></code>
|
|||
|
<em>can</em> contain blank lines.</p>
|
|||
|
<h2 data-sourcepos="2842:1-2842:29" dir="auto">
|
|||
|
<a id="user-content-link-reference-definitions" class="anchor" href="#link-reference-definitions" aria-hidden="true"></a>Link reference definitions</h2>
|
|||
|
<p data-sourcepos="2844:1-2852:61" dir="auto">A <a href="@">link reference definition</a>
|
|||
|
consists of a [link label], indented up to three spaces, followed
|
|||
|
by a colon (<code>:</code>), optional [whitespace] (including up to one
|
|||
|
[line ending]), a [link destination],
|
|||
|
optional [whitespace] (including up to one
|
|||
|
[line ending]), and an optional [link
|
|||
|
title], which if it is present must be separated
|
|||
|
from the [link destination] by [whitespace].
|
|||
|
No further [non-whitespace characters] may occur on the line.</p>
|
|||
|
<p data-sourcepos="2854:1-2859:5" dir="auto">A [link reference definition]
|
|||
|
does not correspond to a structural element of a document. Instead, it
|
|||
|
defines a label which can be used in [reference links]
|
|||
|
and reference-style [images] elsewhere in the document. [Link
|
|||
|
reference definitions] can come either before or after the links that use
|
|||
|
them.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2861:1-2865:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url "title"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2867:1-2869:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2872:1-2878:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [foo]: </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> /url </span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> 'the title' </span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2880:1-2882:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="the title">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2885:1-2889:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo*bar\]]:my_(url) 'title (with parens)'</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[Foo*bar\]]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2891:1-2893:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2896:1-2902:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo bar]:</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><my url></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">'title'</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">[Foo bar]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2904:1-2906:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="my%20url" title="title">Foo bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2909:1-2909:41" dir="auto">The title may extend over multiple lines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2911:1-2919:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url '</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">title</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">line1</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">line2</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">'</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2921:1-2927:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">title</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">line1</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">line2</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2930:1-2930:43" dir="auto">However, it may not contain a [blank line]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2932:1-2938:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url 'title</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">with blank line'</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2940:1-2944:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]: /url 'title</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>with blank line'</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>[foo]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2947:1-2947:25" dir="auto">The title may be omitted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2949:1-2954:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]:</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">/url</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2956:1-2958:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2961:1-2961:40" dir="auto">The link destination may not be omitted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2963:1-2967:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]:</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2969:1-2972:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]:</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>[foo]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2974:2-2975:16" dir="auto">However, an empty link destination may be specified using
|
|||
|
angle brackets:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2977:1-2981:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: <></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2983:1-2985:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="2987:1-2988:11" dir="auto">The title must be separated from the link destination by
|
|||
|
whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2990:1-2994:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: <bar>(baz)</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="2996:1-2999:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]: <bar>(baz)</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>[foo]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3002:1-3003:24" dir="auto">Both title and destination can contain backslash escapes
|
|||
|
and literal backslashes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3005:1-3009:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url\bar\*baz "foo\"bar\baz"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3011:1-3013:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url%5Cbar*baz" title="foo&quot;bar\baz">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3016:1-3016:52" dir="auto">A link can come before its corresponding definition:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3018:1-3022:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3024:1-3026:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="url">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3029:1-3030:11" dir="auto">If there are several matching definitions, the first one takes
|
|||
|
precedence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3032:1-3037:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: first</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[foo]: second</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3039:1-3041:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="first">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3044:1-3045:33" dir="auto">As noted in the section on [Links], matching of labels is
|
|||
|
case-insensitive (see [matches]).</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3047:1-3051:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[FOO]: /url</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[Foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3053:1-3055:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">Foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3058:1-3062:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[ΑΓΩ]: /φου</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[αγω]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3064:1-3066:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3069:1-3070:39" dir="auto">Here is a link reference definition with no corresponding link.
|
|||
|
It contributes nothing to the document.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3072:1-3074:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3076:1-3077:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3080:1-3080:20" dir="auto">Here is another one:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3082:1-3087:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">]: /url</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3089:1-3091:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3094:1-3095:44" dir="auto">This is not a link reference definition, because there are
|
|||
|
[non-whitespace characters] after the title:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3097:1-3099:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url "title" ok</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3101:1-3103:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]: /url &quot;title&quot; ok</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3106:1-3106:57" dir="auto">This is a link reference definition, but it has no title:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3108:1-3111:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">"title" ok</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3113:1-3115:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&quot;title&quot; ok</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3118:1-3119:12" dir="auto">This is not a link reference definition, because it is indented
|
|||
|
four spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3121:1-3125:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [foo]: /url "title"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3127:1-3131:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>[foo]: /url &quot;title&quot;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>[foo]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3134:1-3135:13" dir="auto">This is not a link reference definition, because it occurs inside
|
|||
|
a code block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3137:1-3143:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[foo]: /url</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3145:1-3149:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>[foo]: /url</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>[foo]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3152:1-3152:59" dir="auto">A [link reference definition] cannot interrupt a paragraph.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3154:1-3159:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[bar]: /baz</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[bar]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3161:1-3165:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[bar]: /baz</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>[bar]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3168:1-3169:65" dir="auto">However, it can directly follow other block elements, such as headings
|
|||
|
and thematic breaks, and it need not be followed by a blank line.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3171:1-3175:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># [Foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[foo]: /url</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3177:1-3182:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1><a href="/url">Foo</a></h1></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3184:1-3189:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">===</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3191:1-3194:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>bar</h1></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3196:1-3200:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">===</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3202:1-3205:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>===</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><a href="/url">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3208:1-3209:61" dir="auto">Several [link reference definitions]
|
|||
|
can occur one after another, without intervening blank lines.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3211:1-3220:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /foo-url "foo"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[bar]: /bar-url</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> "bar"</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[baz]: /baz-url</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">[foo],</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">[bar],</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext">[baz]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3222:1-3226:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/foo-url" title="foo">foo</a>,</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><a href="/bar-url" title="bar">bar</a>,</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><a href="/baz-url">baz</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3229:1-3232:12" dir="auto">[Link reference definitions] can occur
|
|||
|
inside block containers, like lists and block quotations. They
|
|||
|
affect the entire document, not just the container in which they
|
|||
|
are defined:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3234:1-3238:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> [foo]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3240:1-3244:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3247:1-3251:19" dir="auto">Whether something is a [link reference definition] is
|
|||
|
independent of whether the link reference it defines is
|
|||
|
used in the document. Thus, for example, the following
|
|||
|
document contains just a link reference definition, and
|
|||
|
no visible content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3253:1-3255:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3257:1-3258:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="3261:1-3261:13" dir="auto">
|
|||
|
<a id="user-content-paragraphs" class="anchor" href="#paragraphs" aria-hidden="true"></a>Paragraphs</h2>
|
|||
|
<p data-sourcepos="3263:1-3268:13" dir="auto">A sequence of non-blank lines that cannot be interpreted as other
|
|||
|
kinds of blocks forms a <a href="@">paragraph</a>.
|
|||
|
The contents of the paragraph are the result of parsing the
|
|||
|
paragraph's raw content as inlines. The paragraph's raw content
|
|||
|
is formed by concatenating the lines and removing initial and final
|
|||
|
[whitespace].</p>
|
|||
|
<p data-sourcepos="3270:1-3270:37" dir="auto">A simple example with two paragraphs:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3272:1-3276:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bbb</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3278:1-3281:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>bbb</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3284:1-3284:58" dir="auto">Paragraphs can contain multiple lines, but no blank lines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3286:1-3292:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">ccc</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">ddd</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3294:1-3299:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>ccc</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">ddd</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3302:1-3302:54" dir="auto">Multiple blank lines between paragraph have no effect:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3304:1-3309:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">bbb</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3311:1-3314:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>bbb</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3317:1-3317:27" dir="auto">Leading spaces are skipped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3319:1-3322:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> bbb</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3324:1-3327:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3330:1-3331:40" dir="auto">Lines after the first may be indented any amount, since indented
|
|||
|
code blocks cannot interrupt paragraphs.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3333:1-3337:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> bbb</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ccc</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3339:1-3343:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">ccc</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3346:1-3347:44" dir="auto">However, the first line may be indented at most three spaces,
|
|||
|
or an indented code block will be triggered:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3349:1-3352:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3354:1-3357:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3360:1-3363:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3365:1-3369:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bbb</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3372:1-3374:7" dir="auto">Final spaces are stripped before inline parsing, so a paragraph
|
|||
|
that ends with two or more spaces will not end with a [hard line
|
|||
|
break]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3376:1-3379:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3381:1-3384:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bbb</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="3387:1-3387:14" dir="auto">
|
|||
|
<a id="user-content-blank-lines" class="anchor" href="#blank-lines" aria-hidden="true"></a>Blank lines</h2>
|
|||
|
<p data-sourcepos="3389:1-3391:22" dir="auto">[Blank lines] between block-level elements are ignored,
|
|||
|
except for the role they play in determining whether a [list]
|
|||
|
is [tight] or [loose].</p>
|
|||
|
<p data-sourcepos="3393:1-3393:70" dir="auto">Blank lines at the beginning and end of the document are also ignored.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3395:1-3404:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">aaa</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> </span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"># aaa</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"> </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3406:1-3409:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h1>aaa</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div>
|
|||
|
<h2 data-sourcepos="3413:1-3413:21">
|
|||
|
<a id="user-content-tables-extension" class="anchor" href="#tables-extension" aria-hidden="true"></a>Tables (extension)</h2>
|
|||
|
<p data-sourcepos="3415:1-3416:10">GFM enables the <code>table</code> extension, where an additional leaf block type is
|
|||
|
available.</p>
|
|||
|
<p data-sourcepos="3418:1-3420:23">A <a href="@">table</a> is an arrangement of data with rows and columns, consisting of a
|
|||
|
single header row, a [delimiter row] separating the header from the data, and
|
|||
|
zero or more data rows.</p>
|
|||
|
<p data-sourcepos="3422:1-3426:23">Each row consists of cells containing arbitrary text, in which [inlines] are
|
|||
|
parsed, separated by pipes (<code>|</code>). A leading and trailing pipe is also
|
|||
|
recommended for clarity of reading, and if there's otherwise parsing ambiguity.
|
|||
|
Spaces between pipes and cell content are trimmed. Block-level elements cannot
|
|||
|
be inserted in a table.</p>
|
|||
|
<p data-sourcepos="3428:1-3430:40">The <a href="@">delimiter row</a> consists of cells whose only content are hyphens (<code>-</code>),
|
|||
|
and optionally, a leading or trailing colon (<code>:</code>), or both, to indicate left,
|
|||
|
right, or center alignment respectively.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3432:1-3436:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| foo | bar |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">| --- | --- |</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">| baz | bim |</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3438:1-3453:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><thead></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><th>foo</th></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><th>bar</th></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></thead></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><tbody></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><td>baz</td></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><td>bim</td></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"></tbody></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3455:1-3456:74">Cells in one column don't need to match length, though it's easier to read if
|
|||
|
they are. Likewise, use of leading and trailing pipes may be inconsistent:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3458:1-3462:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | defghi |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">:-: | -----------:</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar | baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3464:1-3479:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><thead></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><th align="center">abc</th></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><th align="right">defghi</th></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></thead></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><tbody></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><td align="center">bar</td></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><td align="right">baz</td></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"></tbody></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3481:1-3482:13">Include a pipe in a cell's content by escaping it, including inside other
|
|||
|
inline spans:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3484:1-3489:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| f\|oo |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">| ------ |</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">| b `\|` az |</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">| b **\|** im |</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3491:1-3507:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><thead></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><th>f|oo</th></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></thead></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><tbody></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><td>b <code>|</code> az</td></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"><td>b <strong>|</strong> im</td></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"></tbody></span>
|
|||
|
<span id="LC15" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3509:1-3510:22">The table is broken at the first empty line, or beginning of another
|
|||
|
block-level structure:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3512:1-3517:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">| --- | --- |</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">| bar | baz |</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3519:1-3537:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><thead></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><th>abc</th></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><th>def</th></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></thead></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><tbody></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><td>bar</td></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><td>baz</td></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"></tbody></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"></table></span>
|
|||
|
<span id="LC15" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC16" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC17" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3539:1-3546:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">| --- | --- |</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">| bar | baz |</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3548:1-3568:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><thead></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><th>abc</th></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><th>def</th></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></thead></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><tbody></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><td>bar</td></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><td>baz</td></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"><td>bar</td></span>
|
|||
|
<span id="LC15" class="line" lang="plaintext"><td></td></span>
|
|||
|
<span id="LC16" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC17" class="line" lang="plaintext"></tbody></span>
|
|||
|
<span id="LC18" class="line" lang="plaintext"></table></span>
|
|||
|
<span id="LC19" class="line" lang="plaintext"><p>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3570:1-3571:31">The header row must match the [delimiter row] in the number of cells. If not,
|
|||
|
a table will not be recognized:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3573:1-3577:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">| --- |</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">| bar |</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3579:1-3583:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>| abc | def |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">| --- |</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">| bar |</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3585:1-3587:65">The remainder of the table's rows may vary in the number of cells. If there
|
|||
|
are a number of cells fewer than the number of cells in the header row, empty
|
|||
|
cells are inserted. If there are greater, the excess is ignored:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3589:1-3594:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">| --- | --- |</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">| bar |</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">| bar | baz | boo |</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3596:1-3615:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><thead></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><th>abc</th></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><th>def</th></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></thead></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><tbody></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><td>bar</td></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><td></td></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"><td>bar</td></span>
|
|||
|
<span id="LC15" class="line" lang="plaintext"><td>baz</td></span>
|
|||
|
<span id="LC16" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC17" class="line" lang="plaintext"></tbody></span>
|
|||
|
<span id="LC18" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3617:1-3617:75">If there are no rows in the body, no <code><tbody></code> is generated in HTML output:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3619:1-3622:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">| --- | --- |</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3624:1-3633:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><thead></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><tr></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><th>abc</th></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><th>def</th></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></tr></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></thead></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></table></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<h1 data-sourcepos="3637:1-3637:18" dir="auto">
|
|||
|
<a id="user-content-container-blocks" class="anchor" href="#container-blocks" aria-hidden="true"></a>Container blocks</h1>
|
|||
|
<p data-sourcepos="3639:1-3642:45" dir="auto">A <a href="#container-blocks">container block</a> is a block that has other
|
|||
|
blocks as its contents. There are two basic kinds of container blocks:
|
|||
|
[block quotes] and [list items].
|
|||
|
[Lists] are meta-containers for [list items].</p>
|
|||
|
<p data-sourcepos="3644:1-3645:26" dir="auto">We define the syntax for container blocks recursively. The general
|
|||
|
form of the definition is:</p>
|
|||
|
<blockquote data-sourcepos="3647:1-3649:35" dir="auto">
|
|||
|
<p data-sourcepos="3647:3-3649:35">If X is a sequence of blocks, then the result of
|
|||
|
transforming X in such-and-such a way is a container of type Y
|
|||
|
with these blocks as its content.</p>
|
|||
|
</blockquote>
|
|||
|
<p data-sourcepos="3651:1-3655:52" dir="auto">So, we explain what counts as a block quote or list item by explaining
|
|||
|
how these can be <em>generated</em> from their contents. This should suffice
|
|||
|
to define the syntax, although it does not give a recipe for <em>parsing</em>
|
|||
|
these constructions. (A recipe is provided below in the section entitled
|
|||
|
<a href="#appendix-a-parsing-strategy">A parsing strategy</a>.)</p>
|
|||
|
<h2 data-sourcepos="3657:1-3657:15" dir="auto">
|
|||
|
<a id="user-content-block-quotes" class="anchor" href="#block-quotes" aria-hidden="true"></a>Block quotes</h2>
|
|||
|
<p data-sourcepos="3659:1-3661:78" dir="auto">A <a href="@">block quote marker</a>
|
|||
|
consists of 0-3 spaces of initial indent, plus (a) the character <code>></code> together
|
|||
|
with a following space, or (b) a single character <code>></code> not followed by a space.</p>
|
|||
|
<p data-sourcepos="3663:1-3663:42" dir="auto">The following rules define [block quotes]:</p>
|
|||
|
<ol data-sourcepos="3665:1-3682:0" dir="auto">
|
|||
|
<li data-sourcepos="3665:1-3669:0">
|
|||
|
<p data-sourcepos="3665:5-3668:54"><strong>Basic case.</strong> If a string of lines <em>Ls</em> constitute a sequence
|
|||
|
of blocks <em>Bs</em>, then the result of prepending a [block quote
|
|||
|
marker] to the beginning of each line in <em>Ls</em>
|
|||
|
is a <a href="#block-quotes">block quote</a> containing <em>Bs</em>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="3670:1-3679:0">
|
|||
|
<p data-sourcepos="3670:5-3678:48"><strong>Laziness.</strong> If a string of lines <em>Ls</em> constitute a <a href="#block-quotes">block
|
|||
|
quote</a> with contents <em>Bs</em>, then the result of deleting
|
|||
|
the initial [block quote marker] from one or
|
|||
|
more lines in which the next [non-whitespace character] after the [block
|
|||
|
quote marker] is [paragraph continuation
|
|||
|
text] is a block quote with <em>Bs</em> as its content.
|
|||
|
<a href="@">Paragraph continuation text</a> is text
|
|||
|
that will be parsed as part of the content of a paragraph, but does
|
|||
|
not occur at the beginning of the paragraph.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="3680:1-3682:0">
|
|||
|
<p data-sourcepos="3680:5-3681:65"><strong>Consecutiveness.</strong> A document cannot contain two [block
|
|||
|
quotes] in a row unless there is a [blank line] between them.</p>
|
|||
|
</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="3683:1-3683:54" dir="auto">Nothing else counts as a <a href="#block-quotes">block quote</a>.</p>
|
|||
|
<p data-sourcepos="3685:1-3685:25" dir="auto">Here is a simple example:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3687:1-3691:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> # Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3693:1-3699:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">baz</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3702:1-3702:51" dir="auto">The spaces after the <code>></code> characters can be omitted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3704:1-3708:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">># Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">>bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3710:1-3716:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">baz</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3719:1-3719:46" dir="auto">The <code>></code> characters can be indented 1-3 spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3721:1-3725:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > # Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> > bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> > baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3727:1-3733:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">baz</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3736:1-3736:34" dir="auto">Four spaces gives us a code block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3738:1-3742:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > # Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> > bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> > baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3744:1-3749:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>&gt; # Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">&gt; bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">&gt; baz</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3752:1-3753:30" dir="auto">The Laziness clause allows us to omit the <code>></code> before
|
|||
|
[paragraph continuation text]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3755:1-3759:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> # Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3761:1-3767:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">baz</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3770:1-3771:19" dir="auto">A block quote can contain some lazy and some non-lazy
|
|||
|
continuation lines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3773:1-3777:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3779:1-3785:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">baz</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">foo</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3788:1-3790:61" dir="auto">Laziness only applies to lines that would have been continuations of
|
|||
|
paragraphs had they been prepended with [block quote markers].
|
|||
|
For example, the <code>> </code> cannot be omitted in the second line of</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3792:1-3795:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> foo</span></span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="gt">> ---</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3797:1-3797:29" dir="auto">without changing the meaning:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3799:1-3802:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3804:1-3809:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3812:1-3812:52" dir="auto">Similarly, if we omit the <code>> </code> in the second line of</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3814:1-3817:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> - foo</span></span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="gt">> - bar</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3819:1-3819:47" dir="auto">then the block quote ends after the first line:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3821:1-3824:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> - foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3826:1-3835:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3838:1-3839:53" dir="auto">For the same reason, we can't omit the <code>> </code> in front of
|
|||
|
subsequent lines of an indented or fenced code block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3841:1-3844:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3846:1-3853:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><pre><code>bar</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3856:1-3860:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3862:1-3868:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code></code></pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3871:1-3872:19" dir="auto">Note that in the following case, we have a [lazy
|
|||
|
continuation line]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3874:1-3877:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3879:1-3884:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">- bar</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3887:1-3887:24" dir="auto">To see why, note that in</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3889:1-3892:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> foo</span></span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="gt">> - bar</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3894:1-3896:61" dir="auto">the <code>- bar</code> is indented too far to start a list, and can't
|
|||
|
be an indented code block because indented code blocks cannot
|
|||
|
interrupt paragraphs, so it is [paragraph continuation text].</p>
|
|||
|
<p data-sourcepos="3898:1-3898:27" dir="auto">A block quote can be empty:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3900:1-3902:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3904:1-3907:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3910:1-3914:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> </span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3916:1-3919:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3922:1-3922:52" dir="auto">A block quote can have initial or final blank lines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3924:1-3928:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3930:1-3934:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3937:1-3937:43" dir="auto">A blank line always separates block quotes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3939:1-3943:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3945:1-3952:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3955:1-3958:44" dir="auto">(Most current Markdown implementations, including John Gruber's
|
|||
|
original <code>Markdown.pl</code>, will parse this example as a single block quote
|
|||
|
with two paragraphs. But it seems better to allow the author to decide
|
|||
|
whether two block quotes or one are wanted.)</p>
|
|||
|
<p data-sourcepos="3960:1-3961:28" dir="auto">Consecutiveness means that if we put these block quotes together,
|
|||
|
we get a single block quote:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3963:1-3966:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3968:1-3973:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3976:1-3976:46" dir="auto">To get a block quote with two paragraphs, use:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3978:1-3982:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3984:1-3989:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="3992:1-3992:38" dir="auto">Block quotes can interrupt paragraphs:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3994:1-3997:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="3999:1-4004:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4007:1-4008:7" dir="auto">In general, blank lines are not needed before or after block
|
|||
|
quotes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4010:1-4014:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> aaa</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">***</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> bbb</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4016:1-4024:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>aaa</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><hr /></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>bbb</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4027:1-4028:40" dir="auto">However, because of laziness, a blank line is needed between
|
|||
|
a block quote and a following paragraph:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4030:1-4033:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4035:1-4040:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">baz</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4043:1-4047:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4049:1-4054:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4057:1-4061:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4063:1-4068:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4071:1-4073:19" dir="auto">It is a consequence of the Laziness rule that any number
|
|||
|
of initial <code>></code>s may be omitted on a continuation line of a
|
|||
|
nested block quote:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4075:1-4078:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> > > foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4080:1-4089:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">bar</p></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4092:1-4096:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>>> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">>>baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4098:1-4108:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">bar</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">baz</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4111:1-4114:8" dir="auto">When including an indented code block in a block quote,
|
|||
|
remember that the [block quote marker] includes
|
|||
|
both the <code>></code> and a following space. So <em>five spaces</em> are needed after
|
|||
|
the <code>></code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4116:1-4120:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> code</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">> not code</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4122:1-4130:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><pre><code>code</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>not code</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="4134:1-4134:13" dir="auto">
|
|||
|
<a id="user-content-list-items" class="anchor" href="#list-items" aria-hidden="true"></a>List items</h2>
|
|||
|
<p data-sourcepos="4136:1-4137:49" dir="auto">A <a href="@">list marker</a> is a
|
|||
|
[bullet list marker] or an [ordered list marker].</p>
|
|||
|
<p data-sourcepos="4139:1-4140:32" dir="auto">A <a href="@">bullet list marker</a>
|
|||
|
is a <code>-</code>, <code>+</code>, or <code>*</code> character.</p>
|
|||
|
<p data-sourcepos="4142:1-4146:18" dir="auto">An <a href="@">ordered list marker</a>
|
|||
|
is a sequence of 1--9 arabic digits (<code>0-9</code>), followed by either a
|
|||
|
<code>.</code> character or a <code>)</code> character. (The reason for the length
|
|||
|
limit is that with 10 digits we start seeing integer overflows
|
|||
|
in some browsers.)</p>
|
|||
|
<p data-sourcepos="4148:1-4148:40" dir="auto">The following rules define [list items]:</p>
|
|||
|
<ol data-sourcepos="4150:1-4169:0" dir="auto">
|
|||
|
<li data-sourcepos="4150:1-4169:0">
|
|||
|
<p data-sourcepos="4150:5-4158:45"><strong>Basic case.</strong> If a sequence of lines <em>Ls</em> constitute a sequence of
|
|||
|
blocks <em>Bs</em> starting with a [non-whitespace character], and <em>M</em> is a
|
|||
|
list marker of width <em>W</em> followed by 1 ≤ <em>N</em> ≤ 4 spaces, then the result
|
|||
|
of prepending <em>M</em> and the following spaces to the first line of
|
|||
|
<em>Ls</em>, and indenting subsequent lines of <em>Ls</em> by <em>W + N</em> spaces, is a
|
|||
|
list item with <em>Bs</em> as its contents. The type of the list item
|
|||
|
(bullet or ordered) is determined by the type of its list marker.
|
|||
|
If the list item is ordered, then it is also assigned a start
|
|||
|
number, based on the ordered list marker.</p>
|
|||
|
<p data-sourcepos="4160:5-4160:15">Exceptions:</p>
|
|||
|
<ol data-sourcepos="4162:5-4169:0">
|
|||
|
<li data-sourcepos="4162:5-4166:57">When the first list item in a [list] interrupts
|
|||
|
a paragraph---that is, when it starts on a line that would
|
|||
|
otherwise count as [paragraph continuation text]---then (a)
|
|||
|
the lines <em>Ls</em> must not begin with a blank line, and (b) if
|
|||
|
the list item is ordered, the start number must be 1.</li>
|
|||
|
<li data-sourcepos="4167:5-4169:0">If any line is a [thematic break][thematic breaks] then
|
|||
|
that line is not a list item.</li>
|
|||
|
</ol>
|
|||
|
</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="4170:1-4170:34" dir="auto">For example, let <em>Ls</em> be the lines</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4172:1-4179:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">with two lines.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">> A block quote.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4181:1-4189:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">with two lines.</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><pre><code>indented code</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>A block quote.</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4192:1-4194:30" dir="auto">And let <em>M</em> be the marker <code>1.</code>, and <em>N</em> = 2. Then rule #1 says
|
|||
|
that the following is an ordered list item with start number 1,
|
|||
|
and the same contents as <em>Ls</em>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4196:1-4203:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> with two lines.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4205:1-4217:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">with two lines.</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4220:1-4226:5" dir="auto">The most important thing to notice is that the position of
|
|||
|
the text after the list marker determines how much indentation
|
|||
|
is needed in subsequent blocks in the list item. If the list
|
|||
|
marker takes up two spaces, and there are three spaces between
|
|||
|
the list marker and the next [non-whitespace character], then blocks
|
|||
|
must be indented five spaces in order to fall under the list
|
|||
|
item.</p>
|
|||
|
<p data-sourcepos="4228:1-4229:24" dir="auto">Here are some examples showing how far content must be indented to be
|
|||
|
put under the list item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4231:1-4235:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- one</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> two</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4237:1-4242:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>one</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>two</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4245:1-4249:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- one</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> two</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4251:1-4258:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>one</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>two</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4261:1-4265:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - one</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> two</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4267:1-4273:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>one</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code> two</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4276:1-4280:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - one</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> two</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4282:1-4289:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>one</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>two</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4292:1-4298:13" dir="auto">It is tempting to think of this in terms of columns: the continuation
|
|||
|
blocks must be indented at least to the column of the first
|
|||
|
[non-whitespace character] after the list marker. However, that is not quite right.
|
|||
|
The spaces after the list marker determine how much relative indentation
|
|||
|
is needed. Which column this indentation reaches will depend on
|
|||
|
how the list item is embedded in other constructions, as shown by
|
|||
|
this example:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4300:1-4304:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > > 1. one</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">>></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">>> two</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4306:1-4317:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>one</p></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>two</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></ol></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4320:1-4322:67" dir="auto">Here <code>two</code> occurs in the same column as the list marker <code>1.</code>,
|
|||
|
but is actually contained in the list item, because there is
|
|||
|
sufficient indentation after the last containing blockquote marker.</p>
|
|||
|
<p data-sourcepos="4324:1-4327:38" dir="auto">The converse is also possible. In the following example, the word <code>two</code>
|
|||
|
occurs far to the right of the initial text of the list item, <code>one</code>, but
|
|||
|
it is not considered part of the list item, because it is not indented
|
|||
|
far enough past the blockquote marker:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4329:1-4333:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>>- one</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">>></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> > > two</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4335:1-4344:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>one</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>two</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4347:1-4348:51" dir="auto">Note that at least one space is needed between the list marker and
|
|||
|
any following content, so these are not list items:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4350:1-4354:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-one</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">2.two</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4356:1-4359:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>-one</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>2.two</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4362:1-4363:15" dir="auto">A list item may contain blocks that are separated by more than
|
|||
|
one blank line.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4365:1-4370:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4372:1-4379:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4382:1-4382:42" dir="auto">A list item may contain any kind of block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4384:1-4394:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> baz</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"> > bam</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4396:1-4408:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>baz</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><p>bam</p></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4411:1-4412:43" dir="auto">A list item that contains an indented code block will preserve
|
|||
|
empty lines within the code block verbatim.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4414:1-4421:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4423:1-4434:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>Foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">baz</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4436:1-4436:65" dir="auto">Note that ordered list start numbers must be nine digits or less:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4438:1-4440:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">123456789. ok</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4442:1-4446:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="123456789"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>ok</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4449:1-4451:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1234567890. not ok</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4453:1-4455:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>1234567890. not ok</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4458:1-4458:33" dir="auto">A start number may begin with 0s:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4460:1-4462:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">0. ok</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4464:1-4468:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="0"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>ok</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4471:1-4473:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">003. ok</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4475:1-4479:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="3"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>ok</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4482:1-4482:35" dir="auto">A start number may not be negative:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4484:1-4486:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-1. not ok</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4488:1-4490:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>-1. not ok</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<ol start="2" data-sourcepos="4494:1-4504:0" dir="auto">
|
|||
|
<li data-sourcepos="4494:1-4504:0">
|
|||
|
<strong>Item starting with indented code.</strong> If a sequence of lines <em>Ls</em>
|
|||
|
constitute a sequence of blocks <em>Bs</em> starting with an indented code
|
|||
|
block, and <em>M</em> is a list marker of width <em>W</em> followed by
|
|||
|
one space, then the result of prepending <em>M</em> and the following
|
|||
|
space to the first line of <em>Ls</em>, and indenting subsequent lines of
|
|||
|
<em>Ls</em> by <em>W + 1</em> spaces, is a list item with <em>Bs</em> as its contents.
|
|||
|
If a line is empty, then it need not be indented. The type of the
|
|||
|
list item (bullet or ordered) is determined by the type of its list
|
|||
|
marker. If the list item is ordered, then it is also assigned a
|
|||
|
start number, based on the ordered list marker.</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="4505:1-4507:39" dir="auto">An indented code block will have to be indented four spaces beyond
|
|||
|
the edge of the region where text will be included in the list item.
|
|||
|
In the following case that is 6 spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4509:1-4513:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4515:1-4523:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4526:1-4526:33" dir="auto">And in this case it is 11 spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4528:1-4532:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 10. foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4534:1-4542:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="10"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4545:1-4547:12" dir="auto">If the <em>first</em> block in the list item is an indented code block,
|
|||
|
then by rule #2, the contents must be indented <em>one</em> space after the
|
|||
|
list marker:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4549:1-4555:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">paragraph</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> more code</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4557:1-4563:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>indented code</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>paragraph</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code>more code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4566:1-4572:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. indented code</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> paragraph</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> more code</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4574:1-4584:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><pre><code>indented code</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>paragraph</p></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><pre><code>more code</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4587:1-4588:22" dir="auto">Note that an additional space indent is interpreted as space
|
|||
|
inside the code block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4590:1-4596:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. indented code</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> paragraph</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> more code</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4598:1-4608:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><pre><code> indented code</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>paragraph</p></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><pre><code>more code</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4611:1-4617:55" dir="auto">Note that rules #1 and #2 only apply to two cases: (a) cases
|
|||
|
in which the lines to be included in a list item begin with a
|
|||
|
[non-whitespace character], and (b) cases in which
|
|||
|
they begin with an indented code
|
|||
|
block. In a case like the following, where the first block begins with
|
|||
|
a three-space indent, the rules do not allow us to form a list item by
|
|||
|
indenting the whole thing and prepending a list marker:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4619:1-4623:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4625:1-4628:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4631:1-4635:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4637:1-4642:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4645:1-4648:15" dir="auto">This is not a significant restriction, because when a block begins
|
|||
|
with 1-3 spaces indent, the indentation can always be removed without
|
|||
|
a change in interpretation, allowing rule #1 to be applied. So, in
|
|||
|
the above case:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4650:1-4654:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4656:1-4663:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<ol start="3" data-sourcepos="4666:1-4677:0" dir="auto">
|
|||
|
<li data-sourcepos="4666:1-4677:0">
|
|||
|
<strong>Item starting with a blank line.</strong> If a sequence of lines <em>Ls</em>
|
|||
|
starting with a single [blank line] constitute a (possibly empty)
|
|||
|
sequence of blocks <em>Bs</em>, not separated from each other by more than
|
|||
|
one blank line, and <em>M</em> is a list marker of width <em>W</em>,
|
|||
|
then the result of prepending <em>M</em> to the first line of <em>Ls</em>, and
|
|||
|
indenting subsequent lines of <em>Ls</em> by <em>W + 1</em> spaces, is a list
|
|||
|
item with <em>Bs</em> as its contents.
|
|||
|
If a line is empty, then it need not be indented. The type of the
|
|||
|
list item (bullet or ordered) is determined by the type of its list
|
|||
|
marker. If the list item is ordered, then it is also assigned a
|
|||
|
start number, based on the ordered list marker.</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="4678:1-4678:72" dir="auto">Here are some list items that start with a blank line but are not empty:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4680:1-4689:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">-</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> bar</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">-</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"> baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4691:1-4703:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><pre><code>baz</span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4705:1-4706:66" dir="auto">When the list item starts with a blank line, the number of spaces
|
|||
|
following the list marker doesn't change the required indentation:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4708:1-4711:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4713:1-4717:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4720:1-4722:5" dir="auto">A list item can begin with at most one blank line.
|
|||
|
In the following example, <code>foo</code> is not part of the list
|
|||
|
item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4724:1-4728:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4730:1-4735:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>foo</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4738:1-4738:34" dir="auto">Here is an empty bullet list item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4740:1-4744:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">-</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">- bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4746:1-4752:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li></li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4755:1-4755:72" dir="auto">It does not matter whether there are spaces following the [list marker]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4757:1-4761:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- </span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">- bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4763:1-4769:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li></li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4772:1-4772:35" dir="auto">Here is an empty ordered list item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4774:1-4778:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">2.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">3. bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4780:1-4786:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li></li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4789:1-4789:48" dir="auto">A list may start or end with an empty list item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4791:1-4793:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4795:1-4799:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4801:1-4801:57" dir="auto">However, an empty list item cannot interrupt a paragraph:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4803:1-4809:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">1.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4811:1-4816:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">1.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<ol start="4" data-sourcepos="4819:1-4824:0" dir="auto">
|
|||
|
<li data-sourcepos="4819:1-4824:0">
|
|||
|
<strong>Indentation.</strong> If a sequence of lines <em>Ls</em> constitutes a list item
|
|||
|
according to rule #1, #2, or #3, then the result of indenting each line
|
|||
|
of <em>Ls</em> by 1-3 spaces (the same for each line) also constitutes a
|
|||
|
list item with the same contents and attributes. If a line is
|
|||
|
empty, then it need not be indented.</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="4825:1-4825:19" dir="auto">Indented one space:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4827:1-4834:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> with two lines.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4836:1-4848:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">with two lines.</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4851:1-4851:20" dir="auto">Indented two spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4853:1-4860:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> with two lines.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4862:1-4874:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">with two lines.</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4877:1-4877:22" dir="auto">Indented three spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4879:1-4886:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> with two lines.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4888:1-4900:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">with two lines.</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4903:1-4903:38" dir="auto">Four spaces indent gives a code block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4905:1-4912:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> with two lines.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4914:1-4922:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>1. A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> with two lines.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> &gt; A block quote.</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<ol start="5" data-sourcepos="4926:1-4934:0" dir="auto">
|
|||
|
<li data-sourcepos="4926:1-4934:0">
|
|||
|
<strong>Laziness.</strong> If a string of lines <em>Ls</em> constitute a <a href="#list-items">list
|
|||
|
item</a> with contents <em>Bs</em>, then the result of deleting
|
|||
|
some or all of the indentation from one or more lines in which the
|
|||
|
next [non-whitespace character] after the indentation is
|
|||
|
[paragraph continuation text] is a
|
|||
|
list item with the same contents and attributes. The unindented
|
|||
|
lines are called
|
|||
|
<a href="@">lazy continuation line</a>s.</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="4935:1-4935:50" dir="auto">Here is an example with [lazy continuation lines]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4937:1-4944:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">with two lines.</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> indented code</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4946:1-4958:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">with two lines.</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4961:1-4961:37" dir="auto">Indentation can be partially deleted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4963:1-4966:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> with two lines.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4968:1-4973:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>A paragraph</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">with two lines.</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="4976:1-4976:63" dir="auto">These examples show how laziness can work in nested structures:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4978:1-4981:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> 1. > Blockquote</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">continued here.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4983:1-4994:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>Blockquote</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">continued here.</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ol></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="4997:1-5000:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> 1. > Blockquote</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">> continued here.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5002:1-5013:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>Blockquote</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">continued here.</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ol></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<ol start="6" data-sourcepos="5017:1-5019:0" dir="auto">
|
|||
|
<li data-sourcepos="5017:1-5019:0">
|
|||
|
<strong>That's all.</strong> Nothing that is not counted as a list item by rules
|
|||
|
#1--5 counts as a <a href="#list-items">list item</a>.</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="5020:1-5023:17" dir="auto">The rules for sublists follow from the general rules
|
|||
|
[above][List items]. A sublist must be indented the same number
|
|||
|
of spaces a paragraph would need to be in order to be included
|
|||
|
in the list item.</p>
|
|||
|
<p data-sourcepos="5025:1-5025:43" dir="auto">So, in this case we need two spaces indent:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5027:1-5032:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> - baz</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> - boo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5034:1-5050:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>baz</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><li>boo</li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC15" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5053:1-5053:18" dir="auto">One is not enough:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5055:1-5060:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> - baz</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> - boo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5062:1-5069:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>baz</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li>boo</li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5072:1-5072:52" dir="auto">Here we need four, because the list marker is wider:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5074:1-5077:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">10) foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5079:1-5087:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="10"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5090:1-5090:20" dir="auto">Three is not enough:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5092:1-5095:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">10) foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5097:1-5104:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="10"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ol></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5107:1-5107:45" dir="auto">A list may be the first block in a list item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5109:1-5111:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5113:1-5121:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5124:1-5126:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. - 2. foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5128:1-5140:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><ol start="2"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ol></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5143:1-5143:34" dir="auto">A list item can contain a heading:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5145:1-5150:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- # Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- Bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ---</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5152:1-5161:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h1>Foo</h1></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><h2>Bar</h2></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">baz</li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h3 data-sourcepos="5164:1-5164:14" dir="auto">
|
|||
|
<a id="user-content-motivation" class="anchor" href="#motivation" aria-hidden="true"></a>Motivation</h3>
|
|||
|
<p data-sourcepos="5166:1-5166:64" dir="auto">John Gruber's Markdown spec says the following about list items:</p>
|
|||
|
<ol data-sourcepos="5168:1-5187:0" dir="auto">
|
|||
|
<li data-sourcepos="5168:1-5171:0">
|
|||
|
<p data-sourcepos="5168:4-5170:20">"List markers typically start at the left margin, but may be indented
|
|||
|
by up to three spaces. List markers must be followed by one or more
|
|||
|
spaces or a tab."</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="5172:1-5174:0">
|
|||
|
<p data-sourcepos="5172:4-5173:48">"To make lists look nice, you can wrap items with hanging indents....
|
|||
|
But if you don't want to, you don't have to."</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="5175:1-5178:0">
|
|||
|
<p data-sourcepos="5175:4-5177:8">"List items may consist of multiple paragraphs. Each subsequent
|
|||
|
paragraph in a list item must be indented by either 4 spaces or one
|
|||
|
tab."</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="5179:1-5181:0">
|
|||
|
<p data-sourcepos="5179:4-5180:55">"It looks nice if you indent every line of the subsequent paragraphs,
|
|||
|
but here again, Markdown will allow you to be lazy."</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="5182:1-5184:0">
|
|||
|
<p data-sourcepos="5182:4-5183:35">"To put a blockquote within a list item, the blockquote's <code>></code>
|
|||
|
delimiters need to be indented."</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="5185:1-5187:0">
|
|||
|
<p data-sourcepos="5185:4-5186:44">"To put a code block within a list item, the code block needs to be
|
|||
|
indented twice — 8 spaces or two tabs."</p>
|
|||
|
</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="5188:1-5197:18" dir="auto">These rules specify that a paragraph under a list item must be indented
|
|||
|
four spaces (presumably, from the left margin, rather than the start of
|
|||
|
the list marker, but this is not said), and that code under a list item
|
|||
|
must be indented eight spaces instead of the usual four. They also say
|
|||
|
that a block quote must be indented, but not by how much; however, the
|
|||
|
example given has four spaces indentation. Although nothing is said
|
|||
|
about other kinds of block-level content, it is certainly reasonable to
|
|||
|
infer that <em>all</em> block elements under a list item, including other
|
|||
|
lists, must be indented four spaces. This principle has been called the
|
|||
|
<em>four-space rule</em>.</p>
|
|||
|
<p data-sourcepos="5199:1-5210:48" dir="auto">The four-space rule is clear and principled, and if the reference
|
|||
|
implementation <code>Markdown.pl</code> had followed it, it probably would have
|
|||
|
become the standard. However, <code>Markdown.pl</code> allowed paragraphs and
|
|||
|
sublists to start with only two spaces indentation, at least on the
|
|||
|
outer level. Worse, its behavior was inconsistent: a sublist of an
|
|||
|
outer-level list needed two spaces indentation, but a sublist of this
|
|||
|
sublist needed three spaces. It is not surprising, then, that different
|
|||
|
implementations of Markdown have developed very different rules for
|
|||
|
determining what comes under a list item. (Pandoc and python-Markdown,
|
|||
|
for example, stuck with Gruber's syntax description and the four-space
|
|||
|
rule, while discount, redcarpet, marked, PHP Markdown, and others
|
|||
|
followed <code>Markdown.pl</code>'s behavior more closely.)</p>
|
|||
|
<p data-sourcepos="5212:1-5217:45" dir="auto">Unfortunately, given the divergences between implementations, there
|
|||
|
is no way to give a spec for list items that will be guaranteed not
|
|||
|
to break any existing documents. However, the spec given here should
|
|||
|
correctly handle lists formatted with either the four-space rule or
|
|||
|
the more forgiving <code>Markdown.pl</code> behavior, provided they are laid out
|
|||
|
in a way that is natural for a human to read.</p>
|
|||
|
<p data-sourcepos="5219:1-5225:22" dir="auto">The strategy here is to let the width and indentation of the list marker
|
|||
|
determine the indentation necessary for blocks to fall under the list
|
|||
|
item, rather than having a fixed and arbitrary number. The writer can
|
|||
|
think of the body of the list item as a unit which gets indented to the
|
|||
|
right enough to fit the list marker (and any indentation on the list
|
|||
|
marker). (The laziness rule, #5, then allows continuation lines to be
|
|||
|
unindented if needed.)</p>
|
|||
|
<p data-sourcepos="5227:1-5229:39" dir="auto">This rule is superior, we claim, to any rule requiring a fixed level of
|
|||
|
indentation from the margin. The four-space rule is clear but
|
|||
|
unnatural. It is quite unintuitive that</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5231:1-5237:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p">-</span> foo</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"></span>
|
|||
|
<span id="LC3" class="line" lang="markdown"> bar</span>
|
|||
|
<span id="LC4" class="line" lang="markdown"></span>
|
|||
|
<span id="LC5" class="line" lang="markdown"><span class="p"> -</span> baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5239:1-5239:60" dir="auto">should be parsed as two lists with an intervening paragraph,</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5241:1-5249:3" lang="html" class="code highlight js-syntax-highlight language-html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span>
|
|||
|
<span id="LC2" class="line" lang="html"><span class="nt"><li></span>foo<span class="nt"></li></span></span>
|
|||
|
<span id="LC3" class="line" lang="html"><span class="nt"></ul></span></span>
|
|||
|
<span id="LC4" class="line" lang="html"><span class="nt"><p></span>bar<span class="nt"></p></span></span>
|
|||
|
<span id="LC5" class="line" lang="html"><span class="nt"><ul></span></span>
|
|||
|
<span id="LC6" class="line" lang="html"><span class="nt"><li></span>baz<span class="nt"></li></span></span>
|
|||
|
<span id="LC7" class="line" lang="html"><span class="nt"></ul></span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5251:1-5251:58" dir="auto">as the four-space rule demands, rather than a single list,</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5253:1-5263:3" lang="html" class="code highlight js-syntax-highlight language-html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span>
|
|||
|
<span id="LC2" class="line" lang="html"><span class="nt"><li></span></span>
|
|||
|
<span id="LC3" class="line" lang="html"><span class="nt"><p></span>foo<span class="nt"></p></span></span>
|
|||
|
<span id="LC4" class="line" lang="html"><span class="nt"><p></span>bar<span class="nt"></p></span></span>
|
|||
|
<span id="LC5" class="line" lang="html"><span class="nt"><ul></span></span>
|
|||
|
<span id="LC6" class="line" lang="html"><span class="nt"><li></span>baz<span class="nt"></li></span></span>
|
|||
|
<span id="LC7" class="line" lang="html"><span class="nt"></ul></span></span>
|
|||
|
<span id="LC8" class="line" lang="html"><span class="nt"></li></span></span>
|
|||
|
<span id="LC9" class="line" lang="html"><span class="nt"></ul></span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5265:1-5266:62" dir="auto">The choice of four spaces is arbitrary. It can be learned, but it is
|
|||
|
not likely to be guessed, and it trips up beginners regularly.</p>
|
|||
|
<p data-sourcepos="5268:1-5272:20" dir="auto">Would it help to adopt a two-space rule? The problem is that such
|
|||
|
a rule, together with the rule allowing 1--3 spaces indentation of the
|
|||
|
initial list marker, allows text that is indented <em>less than</em> the
|
|||
|
original list marker to be included in the list item. For example,
|
|||
|
<code>Markdown.pl</code> parses</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5274:1-5278:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> -</span> one</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"></span>
|
|||
|
<span id="LC3" class="line" lang="markdown"> two</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5280:1-5280:59" dir="auto">as a single list item, with <code>two</code> a continuation paragraph:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5282:1-5289:3" lang="html" class="code highlight js-syntax-highlight language-html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span>
|
|||
|
<span id="LC2" class="line" lang="html"><span class="nt"><li></span></span>
|
|||
|
<span id="LC3" class="line" lang="html"><span class="nt"><p></span>one<span class="nt"></p></span></span>
|
|||
|
<span id="LC4" class="line" lang="html"><span class="nt"><p></span>two<span class="nt"></p></span></span>
|
|||
|
<span id="LC5" class="line" lang="html"><span class="nt"></li></span></span>
|
|||
|
<span id="LC6" class="line" lang="html"><span class="nt"></ul></span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5291:1-5291:13" dir="auto">and similarly</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5293:1-5297:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> - one</span></span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="gt">></span></span>
|
|||
|
<span id="LC3" class="line" lang="markdown"><span class="gt">> two</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5299:1-5299:2" dir="auto">as</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5301:1-5310:3" lang="html" class="code highlight js-syntax-highlight language-html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><blockquote></span></span>
|
|||
|
<span id="LC2" class="line" lang="html"><span class="nt"><ul></span></span>
|
|||
|
<span id="LC3" class="line" lang="html"><span class="nt"><li></span></span>
|
|||
|
<span id="LC4" class="line" lang="html"><span class="nt"><p></span>one<span class="nt"></p></span></span>
|
|||
|
<span id="LC5" class="line" lang="html"><span class="nt"><p></span>two<span class="nt"></p></span></span>
|
|||
|
<span id="LC6" class="line" lang="html"><span class="nt"></li></span></span>
|
|||
|
<span id="LC7" class="line" lang="html"><span class="nt"></ul></span></span>
|
|||
|
<span id="LC8" class="line" lang="html"><span class="nt"></blockquote></span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5312:1-5312:30" dir="auto">This is extremely unintuitive.</p>
|
|||
|
<p data-sourcepos="5314:1-5319:52" dir="auto">Rather than requiring a fixed indent from the margin, we could require
|
|||
|
a fixed indent (say, two spaces, or even one space) from the list marker (which
|
|||
|
may itself be indented). This proposal would remove the last anomaly
|
|||
|
discussed. Unlike the spec presented above, it would count the following
|
|||
|
as a list item with a subparagraph, even though the paragraph <code>bar</code>
|
|||
|
is not indented as far as the first paragraph <code>foo</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5321:1-5325:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> 10.</span> foo</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"></span>
|
|||
|
<span id="LC3" class="line" lang="markdown"> bar </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5327:1-5330:62" dir="auto">Arguably this text does read like a list item with <code>bar</code> as a subparagraph,
|
|||
|
which may count in favor of the proposal. However, on this proposal indented
|
|||
|
code would have to be indented six spaces after the list marker. And this
|
|||
|
would break a lot of existing Markdown, which has the pattern:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5332:1-5336:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p">1.</span> foo</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"></span>
|
|||
|
<span id="LC3" class="line" lang="markdown"><span class="sb"> indented code</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5338:1-5340:28" dir="auto">where the code is indented eight spaces. The spec above, by contrast, will
|
|||
|
parse this text as expected, since the code block's indentation is measured
|
|||
|
from the beginning of <code>foo</code>.</p>
|
|||
|
<p data-sourcepos="5342:1-5348:62" dir="auto">The one case that needs special treatment is a list item that <em>starts</em>
|
|||
|
with indented code. How much indentation is required in that case, since
|
|||
|
we don't have a "first paragraph" to measure from? Rule #2 simply stipulates
|
|||
|
that in such cases, we require one space indentation from the list marker
|
|||
|
(and then the normal four spaces for the indented code). This will match the
|
|||
|
four-space rule in cases where the list marker plus its initial indentation
|
|||
|
takes four spaces (a common case), but diverge in other cases.</p>
|
|||
|
<div>
|
|||
|
<h2 data-sourcepos="5352:1-5352:30">
|
|||
|
<a id="user-content-task-list-items-extension" class="anchor" href="#task-list-items-extension" aria-hidden="true"></a>Task list items (extension)</h2>
|
|||
|
<p data-sourcepos="5354:1-5355:26">GFM enables the <code>tasklist</code> extension, where an additional processing step is
|
|||
|
performed on [list items].</p>
|
|||
|
<p data-sourcepos="5357:1-5359:46">A <a href="@">task list item</a> is a [list item][list items] where the first block in it
|
|||
|
is a paragraph which begins with a [task list item marker] and at least one
|
|||
|
whitespace character before any other content.</p>
|
|||
|
<p data-sourcepos="5361:1-5363:55">A <a href="@">task list item marker</a> consists of an optional number of spaces, a left
|
|||
|
bracket (<code>[</code>), either a whitespace character or the letter <code>x</code> in either
|
|||
|
lowercase or uppercase, and then a right bracket (<code>]</code>).</p>
|
|||
|
<p data-sourcepos="5365:1-5366:70">When rendered, the [task list item marker] is replaced with a semantic checkbox element;
|
|||
|
in an HTML output, this would be an <code><input type="checkbox"></code> element.</p>
|
|||
|
<p data-sourcepos="5368:1-5369:50">If the character between the brackets is a whitespace character, the checkbox
|
|||
|
is unchecked. Otherwise, the checkbox is checked.</p>
|
|||
|
<p data-sourcepos="5371:1-5374:28">This spec does not define how the checkbox elements are interacted with: in practice,
|
|||
|
implementors are free to render the checkboxes as disabled or inmutable elements,
|
|||
|
or they may dynamically handle dynamic interactions (i.e. checking, unchecking) in
|
|||
|
the final rendered document.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5376:1-5379:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- [x] bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5381:1-5386:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> bar</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5388:1-5388:37">Task lists can be arbitrarily nested:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5390:1-5395:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [x] foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - [ ] bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> - [x] baz</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">- [ ] bim</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5397:1-5407:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> bar</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> baz</li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> bim</li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="5411:1-5411:8" dir="auto">
|
|||
|
<a id="user-content-lists" class="anchor" href="#lists" aria-hidden="true"></a>Lists</h2>
|
|||
|
<p data-sourcepos="5413:1-5415:46" dir="auto">A <a href="@">list</a> is a sequence of one or more
|
|||
|
list items [of the same type]. The list items
|
|||
|
may be separated by any number of blank lines.</p>
|
|||
|
<p data-sourcepos="5417:1-5422:30" dir="auto">Two list items are <a href="@">of the same type</a>
|
|||
|
if they begin with a [list marker] of the same type.
|
|||
|
Two list markers are of the
|
|||
|
same type if (a) they are bullet list markers using the same character
|
|||
|
(<code>-</code>, <code>+</code>, or <code>*</code>) or (b) they are ordered list numbers with the same
|
|||
|
delimiter (either <code>.</code> or <code>)</code>).</p>
|
|||
|
<p data-sourcepos="5424:1-5428:39" dir="auto">A list is an <a href="@">ordered list</a>
|
|||
|
if its constituent list items begin with
|
|||
|
[ordered list markers], and a
|
|||
|
<a href="@">bullet list</a> if its constituent list
|
|||
|
items begin with [bullet list markers].</p>
|
|||
|
<p data-sourcepos="5430:1-5433:12" dir="auto">The <a href="@">start number</a>
|
|||
|
of an [ordered list] is determined by the list number of
|
|||
|
its initial list item. The numbers of subsequent list items are
|
|||
|
disregarded.</p>
|
|||
|
<p data-sourcepos="5435:1-5440:65" dir="auto">A list is <a href="@">loose</a> if any of its constituent
|
|||
|
list items are separated by blank lines, or if any of its constituent
|
|||
|
list items directly contain two block-level elements with a blank line
|
|||
|
between them. Otherwise a list is <a href="@">tight</a>.
|
|||
|
(The difference in HTML output is that paragraphs in a loose list are
|
|||
|
wrapped in <code><p></code> tags, while paragraphs in a tight list are not.)</p>
|
|||
|
<p data-sourcepos="5442:1-5442:64" dir="auto">Changing the bullet or ordered list delimiter starts a new list:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5444:1-5448:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">+ baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5450:1-5458:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>baz</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5461:1-5465:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">2. bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">3) baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5467:1-5475:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ol></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><ol start="3"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>baz</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5478:1-5480:5" dir="auto">In CommonMark, a list can interrupt a paragraph. That is,
|
|||
|
no blank line is needed to separate a paragraph from a following
|
|||
|
list:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5482:1-5486:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">- baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5488:1-5494:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>baz</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5496:1-5497:37" dir="auto"><code>Markdown.pl</code> does not allow this, through fear of triggering a list
|
|||
|
via a numeral in a hard-wrapped line:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5499:1-5502:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">The number of windows in my house is</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="p">14.</span> The number of doors is 6.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5504:1-5506:6" dir="auto">Oddly, though, <code>Markdown.pl</code> <em>does</em> allow a blockquote to
|
|||
|
interrupt a paragraph, even though the same considerations might
|
|||
|
apply.</p>
|
|||
|
<p data-sourcepos="5508:1-5510:35" dir="auto">In CommonMark, we do allow lists to interrupt paragraphs, for
|
|||
|
two reasons. First, it is natural and not uncommon for people
|
|||
|
to start lists without blank lines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5512:1-5517:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">I need to buy</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="p">-</span> new shoes</span>
|
|||
|
<span id="LC3" class="line" lang="markdown"><span class="p">-</span> a coat</span>
|
|||
|
<span id="LC4" class="line" lang="markdown"><span class="p">-</span> a plane ticket</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5519:1-5519:29" dir="auto">Second, we are attracted to a</p>
|
|||
|
<blockquote data-sourcepos="5521:1-5524:54" dir="auto">
|
|||
|
<p data-sourcepos="5521:3-5524:54"><a href="@">principle of uniformity</a>:
|
|||
|
if a chunk of text has a certain
|
|||
|
meaning, it will continue to have the same meaning when put into a
|
|||
|
container block (such as a list item or blockquote).</p>
|
|||
|
</blockquote>
|
|||
|
<p data-sourcepos="5526:1-5527:47" dir="auto">(Indeed, the spec for [list items] and [block quotes] presupposes
|
|||
|
this principle.) This principle implies that if</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5529:1-5534:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> *</span> I need to buy</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="p"> -</span> new shoes</span>
|
|||
|
<span id="LC3" class="line" lang="markdown"><span class="p"> -</span> a coat</span>
|
|||
|
<span id="LC4" class="line" lang="markdown"><span class="p"> -</span> a plane ticket</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5536:1-5539:4" dir="auto">is a list item containing a paragraph followed by a nested sublist,
|
|||
|
as all Markdown implementations agree it is (though the paragraph
|
|||
|
may be rendered without <code><p></code> tags, since the list is "tight"),
|
|||
|
then</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5541:1-5546:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">I need to buy</span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="p">-</span> new shoes</span>
|
|||
|
<span id="LC3" class="line" lang="markdown"><span class="p">-</span> a coat</span>
|
|||
|
<span id="LC4" class="line" lang="markdown"><span class="p">-</span> a plane ticket</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5548:1-5548:61" dir="auto">by itself should be a paragraph followed by a nested sublist.</p>
|
|||
|
<p data-sourcepos="5550:1-5555:30" dir="auto">Since it is well established Markdown practice to allow lists to
|
|||
|
interrupt paragraphs inside list items, the [principle of
|
|||
|
uniformity] requires us to allow this outside list items as
|
|||
|
well. (<a href="http://docutils.sourceforge.net/rst.html" rel="nofollow noreferrer noopener" target="_blank">reStructuredText</a>
|
|||
|
takes a different approach, requiring blank lines before lists
|
|||
|
even inside other list items.)</p>
|
|||
|
<p data-sourcepos="5557:1-5559:28" dir="auto">In order to solve of unwanted lists in paragraphs with
|
|||
|
hard-wrapped numerals, we allow only lists starting with <code>1</code> to
|
|||
|
interrupt paragraphs. Thus,</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5561:1-5564:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">The number of windows in my house is</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">14. The number of doors is 6.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5566:1-5569:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>The number of windows in my house is</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">14. The number of doors is 6.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5571:1-5571:51" dir="auto">We may still get an unintended result in cases like</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5573:1-5576:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">The number of windows in my house is</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">1. The number of doors is 6.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5578:1-5583:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>The number of windows in my house is</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>The number of doors is 6.</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5585:1-5585:57" dir="auto">but this rule should prevent most spurious list captures.</p>
|
|||
|
<p data-sourcepos="5587:1-5587:53" dir="auto">There can be any number of blank lines between items:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5589:1-5596:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">- bar</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">- baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5598:1-5610:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><p>baz</p></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5612:1-5619:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> - baz</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> bim</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5621:1-5636:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>bar</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><p>baz</p></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><p>bim</p></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5639:1-5642:8" dir="auto">To separate consecutive lists of the same type, or to separate a
|
|||
|
list from an indented code block that would otherwise be parsed
|
|||
|
as a subparagraph of the final list item, you can insert a blank HTML
|
|||
|
comment:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5644:1-5652:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><!-- --></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">- baz</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">- bim</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5654:1-5664:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><!-- --></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><li>baz</li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><li>bim</li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5667:1-5677:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> notcode</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">- foo</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><!-- --></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"> code</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5679:1-5692:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>notcode</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><!-- --></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><pre><code>code</span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5695:1-5698:5" dir="auto">List items need not be indented to the same level. The following
|
|||
|
list items will be treated as items at the same list level,
|
|||
|
since none is indented enough to belong to the previous list
|
|||
|
item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5700:1-5708:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> - c</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> - d</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> - e</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> - f</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">- g</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5710:1-5720:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>a</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>b</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>c</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li>d</li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>e</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><li>f</li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><li>g</li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5723:1-5729:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> 2. b</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> 3. c</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5731:1-5743:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>a</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>b</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><p>c</p></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5745:1-5747:52" dir="auto">Note, however, that list items may not be indented more than
|
|||
|
three spaces. Here <code>- e</code> is treated as a paragraph continuation
|
|||
|
line, because it is indented more than three spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5749:1-5755:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> - c</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> - d</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> - e</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5757:1-5765:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>a</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>b</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>c</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li>d</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">- e</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5767:1-5769:11" dir="auto">And here, <code>3. c</code> is treated as in indented code block,
|
|||
|
because it is indented four spaces and preceded by a
|
|||
|
blank line.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5771:1-5777:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> 2. b</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> 3. c</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5779:1-5790:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>a</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>b</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></ol></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><pre><code>3. c</span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5793:1-5794:22" dir="auto">This is a loose list, because there is a blank line between
|
|||
|
two of the list items:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5796:1-5801:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">- c</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5803:1-5815:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>a</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>b</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><p>c</p></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5818:1-5818:37" dir="auto">So is this, with a empty second item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5820:1-5825:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">* c</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5827:1-5837:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>a</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><p>c</p></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5840:1-5842:31" dir="auto">These are loose lists, even though there is no space between the items,
|
|||
|
because one of the items directly contains two block-level elements
|
|||
|
with a blank line between them:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5844:1-5850:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> c</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">- d</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5852:1-5865:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>a</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>b</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><p>c</p></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><p>d</p></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5868:1-5874:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> [ref]: /url</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">- d</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5876:1-5888:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>a</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>b</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><p>d</p></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5891:1-5891:66" dir="auto">This is a tight list, because the blank lines are in a code block:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5893:1-5901:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">- ```</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> b</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">- c</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5903:1-5914:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>a</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><pre><code>b</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><li>c</li></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5917:1-5919:24" dir="auto">This is a tight list, because the blank line is between two
|
|||
|
paragraphs of a sublist. So the sublist is loose while
|
|||
|
the outer list is tight:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5921:1-5927:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> c</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">- d</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5929:1-5941:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>a</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>b</p></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><p>c</p></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><li>d</li></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5944:1-5945:12" dir="auto">This is a tight list, because the blank line is inside the
|
|||
|
block quote:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5947:1-5952:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> > b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">* c</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5954:1-5963:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>a</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>b</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><li>c</li></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5966:1-5967:33" dir="auto">This list is tight, because the consecutive block elements
|
|||
|
are not separated by blank lines:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5969:1-5976:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> > b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> c</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">- d</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5978:1-5989:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>a</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>b</p></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><pre><code>c</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><li>d</li></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="5992:1-5992:33" dir="auto">A single-paragraph list is tight:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5994:1-5996:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="5998:1-6002:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>a</li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6005:1-6008:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - b</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6010:1-6018:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li>a</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><li>b</li></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6021:1-6022:36" dir="auto">This list is loose, because of the blank line between the
|
|||
|
two block elements in the list item:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6024:1-6030:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. ```</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> ```</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6032:1-6040:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><pre><code>foo</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></pre></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><p>bar</p></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6043:1-6043:51" dir="auto">Here the outer list is loose, the inner list tight:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6045:1-6050:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> * bar</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6052:1-6062:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>foo</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li>bar</li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"><p>baz</p></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6065:1-6073:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> - b</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> - c</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">- d</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> - e</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> - f</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6075:1-6092:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>a</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><li>b</li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><li>c</li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><p>d</p></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"><li>e</li></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"><li>f</li></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"></ul></span>
|
|||
|
<span id="LC15" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC16" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h1 data-sourcepos="6095:1-6095:9" dir="auto">
|
|||
|
<a id="user-content-inlines" class="anchor" href="#inlines" aria-hidden="true"></a>Inlines</h1>
|
|||
|
<p data-sourcepos="6097:1-6099:21" dir="auto">Inlines are parsed sequentially from the beginning of the character
|
|||
|
stream to the end (left to right, in left-to-right languages).
|
|||
|
Thus, for example, in</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6101:1-6103:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`hi`lo`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6105:1-6107:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>hi</code>lo`</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6109:1-6110:9" dir="auto"><code>hi</code> is parsed as code, leaving the backtick at the end as a literal
|
|||
|
backtick.</p>
|
|||
|
<h2 data-sourcepos="6113:1-6113:20" dir="auto">
|
|||
|
<a id="user-content-backslash-escapes" class="anchor" href="#backslash-escapes" aria-hidden="true"></a>Backslash escapes</h2>
|
|||
|
<p data-sourcepos="6115:1-6115:57" dir="auto">Any ASCII punctuation character may be backslash-escaped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6117:1-6119:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6121:1-6123:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>!&quot;#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6126:1-6127:12" dir="auto">Backslashes before other characters are treated as literal
|
|||
|
backslashes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6129:1-6131:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\→\A\a\ \3\φ\«</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6133:1-6135:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>\→\A\a\ \3\φ\«</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6138:1-6139:39" dir="auto">Escaped characters are treated as regular characters and do
|
|||
|
not have their usual Markdown meanings:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6141:1-6151:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\*not emphasized*</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">\<br/> not a tag</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">\[not a link](/foo)</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">\`not code`</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">1\. not a list</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">\* not a list</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">\# not a heading</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext">\[foo]: /url "not a reference"</span>
|
|||
|
<span id="LC9" class="line" lang="plaintext">\&ouml; not a character entity</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6153:1-6163:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*not emphasized*</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">&lt;br/&gt; not a tag</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[not a link](/foo)</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">`not code`</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">1. not a list</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">* not a list</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"># not a heading</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext">[foo]: /url &quot;not a reference&quot;</span>
|
|||
|
<span id="LC9" class="line" lang="plaintext">&amp;ouml; not a character entity</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6166:1-6166:65" dir="auto">If a backslash is itself escaped, the following character is not:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6168:1-6170:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\\*emphasis*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6172:1-6174:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>\<em>emphasis</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6177:1-6177:58" dir="auto">A backslash at the end of the line is a [hard line break]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6179:1-6182:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6184:1-6187:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6190:1-6191:9" dir="auto">Backslash escapes do not work in code blocks, code spans, autolinks, or
|
|||
|
raw HTML:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6193:1-6195:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`` \[\` ``</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6197:1-6199:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>\[\`</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6202:1-6204:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> \[\]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6206:1-6209:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>\[\]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6212:1-6216:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">\[\]</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">~~~</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6218:1-6221:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>\[\]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6224:1-6226:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://example.com?find=\*></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6228:1-6230:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://example.com?find=%5C*">http://example.com?find=\*</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6233:1-6235:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="/bar\/)"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6237:1-6239:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="/bar\/)"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6242:1-6243:60" dir="auto">But they work in all other contexts, including URLs and link titles,
|
|||
|
link references, and [info strings] in [fenced code blocks]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6245:1-6247:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](/bar\* "ti\*tle")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6249:1-6251:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/bar*" title="ti*tle">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6254:1-6258:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /bar\* "ti\*tle"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6260:1-6262:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/bar*" title="ti*tle">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6265:1-6269:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` foo\+bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6271:1-6274:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-foo+bar">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="6278:1-6278:42" dir="auto">
|
|||
|
<a id="user-content-entity-and-numeric-character-references" class="anchor" href="#entity-and-numeric-character-references" aria-hidden="true"></a>Entity and numeric character references</h2>
|
|||
|
<p data-sourcepos="6280:1-6282:30" dir="auto">Valid HTML entity references and numeric character references
|
|||
|
can be used in place of the corresponding Unicode character,
|
|||
|
with the following exceptions:</p>
|
|||
|
<ul data-sourcepos="6284:1-6293:0" dir="auto">
|
|||
|
<li data-sourcepos="6284:1-6286:0">
|
|||
|
<p data-sourcepos="6284:3-6285:24">Entity and character references are not recognized in code
|
|||
|
blocks and code spans.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6287:1-6293:0">
|
|||
|
<p data-sourcepos="6287:3-6292:9">Entity and character references cannot stand in place of
|
|||
|
special characters that define structural elements in
|
|||
|
CommonMark. For example, although <code>&#42;</code> can be used
|
|||
|
in place of a literal <code>*</code> character, <code>&#42;</code> cannot replace
|
|||
|
<code>*</code> in emphasis delimiters, bullet list markers, or thematic
|
|||
|
breaks.</p>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="6294:1-6296:49" dir="auto">Conforming CommonMark parsers need not store information about
|
|||
|
whether a particular character was represented in the source
|
|||
|
using a Unicode character or an entity reference.</p>
|
|||
|
<p data-sourcepos="6298:1-6302:47" dir="auto"><a href="@">Entity references</a> consist of <code>&</code> + any of the valid
|
|||
|
HTML5 entity names + <code>;</code>. The
|
|||
|
document <a href="https://html.spec.whatwg.org/multipage/entities.json" rel="nofollow noreferrer noopener" target="_blank">https://html.spec.whatwg.org/multipage/entities.json</a>
|
|||
|
is used as an authoritative source for the valid entity
|
|||
|
references and their corresponding code points.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6304:1-6308:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&nbsp; &amp; &copy; &AElig; &Dcaron;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">&frac34; &HilbertSpace; &DifferentialD;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">&ClockwiseContourIntegral; &ngE;</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6310:1-6314:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p> &amp; © Æ Ď</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">¾ ℋ ⅆ</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">∲ ≧̸</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6317:1-6323:58" dir="auto"><a href="@">Decimal numeric character
|
|||
|
references</a>
|
|||
|
consist of <code>&#</code> + a string of 1--7 arabic digits + <code>;</code>. A
|
|||
|
numeric character reference is parsed as the corresponding
|
|||
|
Unicode character. Invalid Unicode code points will be replaced by
|
|||
|
the REPLACEMENT CHARACTER (<code>U+FFFD</code>). For security reasons,
|
|||
|
the code point <code>U+0000</code> will also be replaced by <code>U+FFFD</code>.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6325:1-6327:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#35; &#1234; &#992; &#0;</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6329:1-6331:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p># Ӓ Ϡ <20></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6334:1-6338:62" dir="auto"><a href="@">Hexadecimal numeric character
|
|||
|
references</a> consist of <code>&#</code> +
|
|||
|
either <code>X</code> or <code>x</code> + a string of 1-6 hexadecimal digits + <code>;</code>.
|
|||
|
They too are parsed as the corresponding Unicode character (this
|
|||
|
time specified with a hexadecimal numeral instead of decimal).</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6340:1-6342:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#X22; &#XD06; &#xcab;</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6344:1-6346:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&quot; ആ ಫ</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6349:1-6349:26" dir="auto">Here are some nonentities:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6351:1-6356:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&nbsp &x; &#; &#x;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">&#987654321;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">&#abcdef0;</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">&ThisIsNotDefined; &hi?;</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6358:1-6363:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&amp;nbsp &amp;x; &amp;#; &amp;#x;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">&amp;#987654321;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">&amp;#abcdef0;</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">&amp;ThisIsNotDefined; &amp;hi?;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6366:1-6368:60" dir="auto">Although HTML5 does accept some entity references
|
|||
|
without a trailing semicolon (such as <code>&copy</code>), these are not
|
|||
|
recognized here, because it makes the grammar too ambiguous:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6370:1-6372:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&copy</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6374:1-6376:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&amp;copy</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6379:1-6380:39" dir="auto">Strings that are not on the list of HTML5 named entities are not
|
|||
|
recognized as entity references either:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6382:1-6384:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&MadeUpEntity;</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6386:1-6388:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&amp;MadeUpEntity;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6391:1-6393:62" dir="auto">Entity and numeric character references are recognized in any
|
|||
|
context besides code spans or code blocks, including
|
|||
|
URLs, [link titles], and [fenced code block][] [info strings]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6395:1-6397:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="&ouml;&ouml;.html"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6399:1-6401:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="&ouml;&ouml;.html"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6404:1-6406:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](/f&ouml;&ouml; "f&ouml;&ouml;")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6408:1-6410:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6413:1-6417:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /f&ouml;&ouml; "f&ouml;&ouml;"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6419:1-6421:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6424:1-6428:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` f&ouml;&ouml;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">```</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6430:1-6433:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-föö">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6436:1-6437:35" dir="auto">Entity and numeric character references are treated as literal
|
|||
|
text in code spans and code blocks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6439:1-6441:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`f&ouml;&ouml;`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6443:1-6445:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>f&amp;ouml;&amp;ouml;</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6448:1-6450:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> f&ouml;f&ouml;</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6452:1-6455:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>f&amp;ouml;f&amp;ouml;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6458:1-6460:10" dir="auto">Entity and numeric character references cannot be used
|
|||
|
in place of symbols indicating structure in CommonMark
|
|||
|
documents.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6462:1-6465:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#42;foo&#42;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6467:1-6470:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo*</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><em>foo</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6472:1-6476:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#42; foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">* foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6478:1-6483:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>* foo</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><li>foo</li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6485:1-6487:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo&#10;&#10;bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6489:1-6493:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6495:1-6497:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#9;foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6499:1-6501:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>→foo</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6504:1-6506:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](url &quot;tit&quot;)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6508:1-6510:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[a](url &quot;tit&quot;)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="6513:1-6513:13" dir="auto">
|
|||
|
<a id="user-content-code-spans" class="anchor" href="#code-spans" aria-hidden="true"></a>Code spans</h2>
|
|||
|
<p data-sourcepos="6515:1-6517:36" dir="auto">A <a href="@">backtick string</a>
|
|||
|
is a string of one or more backtick characters (<code>`</code>) that is neither
|
|||
|
preceded nor followed by a backtick.</p>
|
|||
|
<p data-sourcepos="6519:1-6522:15" dir="auto">A <a href="@">code span</a> begins with a backtick string and ends with
|
|||
|
a backtick string of equal length. The contents of the code span are
|
|||
|
the characters between the two backtick strings, normalized in the
|
|||
|
following ways:</p>
|
|||
|
<ul data-sourcepos="6524:1-6531:0" dir="auto">
|
|||
|
<li data-sourcepos="6524:1-6524:50">First, [line endings] are converted to [spaces].</li>
|
|||
|
<li data-sourcepos="6525:1-6531:0">If the resulting string both begins <em>and</em> ends with a [space]
|
|||
|
character, but does not consist entirely of [space]
|
|||
|
characters, a single [space] character is removed from the
|
|||
|
front and back. This allows you to include code that begins
|
|||
|
or ends with backtick characters, which must be separated by
|
|||
|
whitespace from the opening or closing backtick strings.</li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="6532:1-6532:27" dir="auto">This is a simple code span:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6534:1-6536:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6538:1-6540:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6543:1-6545:15" dir="auto">Here two backticks are used, because the code contains a backtick.
|
|||
|
This example also illustrates stripping of a single leading and
|
|||
|
trailing space:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6547:1-6549:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`` foo ` bar ``</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6551:1-6553:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo ` bar</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6556:1-6557:7" dir="auto">This example shows the motivation for stripping leading and trailing
|
|||
|
spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6559:1-6561:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `` `</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6563:1-6565:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>``</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6567:1-6567:39" dir="auto">Note that only <em>one</em> space is stripped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6569:1-6571:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `` `</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6573:1-6575:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> `` </code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6577:1-6578:20" dir="auto">The stripping only happens if the space is on both
|
|||
|
sides of the string:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6580:1-6582:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` a`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6584:1-6586:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> a</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6588:1-6589:21" dir="auto">Only [spaces], and not [unicode whitespace] in general, are
|
|||
|
stripped in this way:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6591:1-6593:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` b `</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6595:1-6597:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> b </code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6599:1-6599:58" dir="auto">No stripping occurs if the code span contains only spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6601:1-6604:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">` `</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6606:1-6609:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> </code></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><code> </code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6612:1-6612:39" dir="auto">[Line endings] are treated like spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6614:1-6620:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">bar </span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">baz</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">``</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6622:1-6624:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo bar baz</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6626:1-6630:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo </span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">``</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6632:1-6634:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo </code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6637:1-6637:34" dir="auto">Interior spaces are not collapsed:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6639:1-6642:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo bar </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6644:1-6646:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo bar baz</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6648:1-6650:26" dir="auto">Note that browsers will typically collapse consecutive spaces
|
|||
|
when rendering <code><code></code> elements, so it is recommended that
|
|||
|
the following CSS be used:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6652:5-6654:0" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">code{white-space: pre-wrap;}</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6655:1-6656:22" dir="auto">Note that backslash escapes do not work in code spans. All backslashes
|
|||
|
are treated literally:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6658:1-6660:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo\`bar`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6662:1-6664:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo\</code>bar`</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6667:1-6669:59" dir="auto">Backslash escapes are never needed, because one can always choose a
|
|||
|
string of <em>n</em> backtick characters as delimiters, where the code does
|
|||
|
not contain any strings of exactly <em>n</em> backtick characters.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6671:1-6673:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``foo`bar``</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6675:1-6677:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo`bar</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6679:1-6681:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` foo `` bar `</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6683:1-6685:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo `` bar</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6688:1-6691:5" dir="auto">Code span backticks have higher precedence than any other inline
|
|||
|
constructs except HTML tags and autolinks. Thus, for example, this is
|
|||
|
not parsed as emphasized text, since the second <code>*</code> is part of a code
|
|||
|
span:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6693:1-6695:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo`*`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6697:1-6699:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo<code>*</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6702:1-6702:33" dir="auto">And this is not parsed as a link:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6704:1-6706:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[not a `link](/foo`)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6708:1-6710:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[not a <code>link](/foo</code>)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6713:1-6714:19" dir="auto">Code spans, HTML tags, and autolinks have the same precedence.
|
|||
|
Thus, this is code:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6716:1-6718:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`<a href="`">`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6720:1-6722:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>&lt;a href=&quot;</code>&quot;&gt;`</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6725:1-6725:24" dir="auto">But this is an HTML tag:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6727:1-6729:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="`">`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6731:1-6733:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="`">`</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6736:1-6736:17" dir="auto">And this is code:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6738:1-6740:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`<http://foo.bar.`baz>`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6742:1-6744:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>&lt;http://foo.bar.</code>baz&gt;`</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6747:1-6747:24" dir="auto">But this is an autolink:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6749:1-6751:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.`baz>`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6753:1-6755:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6758:1-6759:31" dir="auto">When a backtick string is not closed by a matching backtick string,
|
|||
|
we just have literal backticks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6761:1-6763:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```foo``</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6765:1-6767:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>```foo``</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6770:1-6772:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6774:1-6776:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>`foo</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6778:1-6779:47" dir="auto">The following case also illustrates the need for opening and
|
|||
|
closing backtick strings to be equal in length:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6781:1-6783:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo``bar``</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6785:1-6787:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>`foo<code>bar</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="6790:1-6790:31" dir="auto">
|
|||
|
<a id="user-content-emphasis-and-strong-emphasis" class="anchor" href="#emphasis-and-strong-emphasis" aria-hidden="true"></a>Emphasis and strong emphasis</h2>
|
|||
|
<p data-sourcepos="6792:1-6793:73" dir="auto">John Gruber's original <a href="http://daringfireball.net/projects/markdown/syntax#em" rel="nofollow noreferrer noopener" target="_blank">Markdown syntax
|
|||
|
description</a> says:</p>
|
|||
|
<blockquote data-sourcepos="6795:1-6798:6" dir="auto">
|
|||
|
<p data-sourcepos="6795:3-6798:6">Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of
|
|||
|
emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an HTML
|
|||
|
<code><em></code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML <code><strong></code>
|
|||
|
tag.</p>
|
|||
|
</blockquote>
|
|||
|
<p data-sourcepos="6800:1-6804:57" dir="auto">This is enough for most users, but these rules leave much undecided,
|
|||
|
especially when it comes to nested emphasis. The original
|
|||
|
<code>Markdown.pl</code> test suite makes it clear that triple <code>***</code> and
|
|||
|
<code>___</code> delimiters can be used for strong emphasis, and most
|
|||
|
implementations have also allowed the following patterns:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6806:1-6812:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gs">***strong emph**</span><span class="err">*</span></span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="gs">***strong**</span> in emph<span class="err">*</span></span>
|
|||
|
<span id="LC3" class="line" lang="markdown"><span class="gs">***emph* in strong**</span></span>
|
|||
|
<span id="LC4" class="line" lang="markdown"><span class="gs">**in strong *emph**</span><span class="err">*</span></span>
|
|||
|
<span id="LC5" class="line" lang="markdown"><span class="ge">*in emph **strong***</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6814:1-6816:9" dir="auto">The following patterns are less widely supported, but the intent
|
|||
|
is clear and they are useful (especially in contexts like bibliography
|
|||
|
entries):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6818:1-6821:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="ge">*emph *</span>with emph<span class="ge">* in it*</span></span>
|
|||
|
<span id="LC2" class="line" lang="markdown"><span class="gs">**strong **</span>with strong<span class="gs">** in it**</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6823:1-6826:31" dir="auto">Many implementations have also restricted intraword emphasis to
|
|||
|
the <code>*</code> forms, to avoid unwanted emphasis in words containing
|
|||
|
internal underscores. (It is best practice to put these in code
|
|||
|
spans, but users often do not.)</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6828:1-6831:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">internal emphasis: foo<span class="ge">*bar*</span>baz</span>
|
|||
|
<span id="LC2" class="line" lang="markdown">no emphasis: foo_bar_baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="6833:1-6834:55" dir="auto">The rules given below capture all of these patterns, while allowing
|
|||
|
for efficient parsing strategies that do not backtrack.</p>
|
|||
|
<p data-sourcepos="6836:1-6840:38" dir="auto">First, some definitions. A <a href="@">delimiter run</a> is either
|
|||
|
a sequence of one or more <code>*</code> characters that is not preceded or
|
|||
|
followed by a non-backslash-escaped <code>*</code> character, or a sequence
|
|||
|
of one or more <code>_</code> characters that is not preceded or followed by
|
|||
|
a non-backslash-escaped <code>_</code> character.</p>
|
|||
|
<p data-sourcepos="6842:1-6848:37" dir="auto">A <a href="@">left-flanking delimiter run</a> is
|
|||
|
a [delimiter run] that is (1) not followed by [Unicode whitespace],
|
|||
|
and either (2a) not followed by a [punctuation character], or
|
|||
|
(2b) followed by a [punctuation character] and
|
|||
|
preceded by [Unicode whitespace] or a [punctuation character].
|
|||
|
For purposes of this definition, the beginning and the end of
|
|||
|
the line count as Unicode whitespace.</p>
|
|||
|
<p data-sourcepos="6850:1-6856:37" dir="auto">A <a href="@">right-flanking delimiter run</a> is
|
|||
|
a [delimiter run] that is (1) not preceded by [Unicode whitespace],
|
|||
|
and either (2a) not preceded by a [punctuation character], or
|
|||
|
(2b) preceded by a [punctuation character] and
|
|||
|
followed by [Unicode whitespace] or a [punctuation character].
|
|||
|
For purposes of this definition, the beginning and the end of
|
|||
|
the line count as Unicode whitespace.</p>
|
|||
|
<p data-sourcepos="6858:1-6858:41" dir="auto">Here are some examples of delimiter runs.</p>
|
|||
|
<ul data-sourcepos="6860:3-6891:0" dir="auto">
|
|||
|
<li data-sourcepos="6860:3-6868:0">
|
|||
|
<p data-sourcepos="6860:5-6860:41">left-flanking but not right-flanking:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6862:5-6867:7" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***abc</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> _abc</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">**"abc"</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> _"abc"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6869:3-6877:0">
|
|||
|
<p data-sourcepos="6869:5-6869:41">right-flanking but not left-flanking:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6871:5-6876:7" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> abc***</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> abc_</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">"abc"**</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">"abc"_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6878:3-6884:0">
|
|||
|
<p data-sourcepos="6878:5-6878:33">Both left and right-flanking:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6880:5-6883:7" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> abc***def</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">"abc"_"def"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6885:3-6891:0">
|
|||
|
<p data-sourcepos="6885:5-6885:36">Neither left nor right-flanking:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="6887:5-6890:7" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">abc *** def</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">a _ b</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="6892:1-6898:49" dir="auto">(The idea of distinguishing left-flanking and right-flanking
|
|||
|
delimiter runs based on the character before and the character
|
|||
|
after comes from Roopesh Chander's
|
|||
|
<a href="http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-emphasis-tags" rel="nofollow noreferrer noopener" target="_blank">vfmd</a>.
|
|||
|
vfmd uses the terminology "emphasis indicator string" instead of "delimiter
|
|||
|
run," and its rules for distinguishing left- and right-flanking runs
|
|||
|
are a bit more complex than the ones given here.)</p>
|
|||
|
<p data-sourcepos="6900:1-6900:56" dir="auto">The following rules define emphasis and strong emphasis:</p>
|
|||
|
<ol data-sourcepos="6902:1-6966:0" dir="auto">
|
|||
|
<li data-sourcepos="6902:1-6904:0">
|
|||
|
<p data-sourcepos="6902:5-6903:71">A single <code>*</code> character <a href="@">can open emphasis</a>
|
|||
|
iff (if and only if) it is part of a [left-flanking delimiter run].</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6905:1-6910:0">
|
|||
|
<p data-sourcepos="6905:5-6909:28">A single <code>_</code> character [can open emphasis] iff
|
|||
|
it is part of a [left-flanking delimiter run]
|
|||
|
and either (a) not part of a [right-flanking delimiter run]
|
|||
|
or (b) part of a [right-flanking delimiter run]
|
|||
|
preceded by punctuation.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6911:1-6913:0">
|
|||
|
<p data-sourcepos="6911:5-6912:55">A single <code>*</code> character <a href="@">can close emphasis</a>
|
|||
|
iff it is part of a [right-flanking delimiter run].</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6914:1-6919:0">
|
|||
|
<p data-sourcepos="6914:5-6918:28">A single <code>_</code> character [can close emphasis] iff
|
|||
|
it is part of a [right-flanking delimiter run]
|
|||
|
and either (a) not part of a [left-flanking delimiter run]
|
|||
|
or (b) part of a [left-flanking delimiter run]
|
|||
|
followed by punctuation.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6920:1-6922:0">
|
|||
|
<p data-sourcepos="6920:5-6921:54">A double <code>**</code> <a href="@">can open strong emphasis</a>
|
|||
|
iff it is part of a [left-flanking delimiter run].</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6923:1-6928:0">
|
|||
|
<p data-sourcepos="6923:5-6927:28">A double <code>__</code> [can open strong emphasis] iff
|
|||
|
it is part of a [left-flanking delimiter run]
|
|||
|
and either (a) not part of a [right-flanking delimiter run]
|
|||
|
or (b) part of a [right-flanking delimiter run]
|
|||
|
preceded by punctuation.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6929:1-6931:0">
|
|||
|
<p data-sourcepos="6929:5-6930:55">A double <code>**</code> <a href="@">can close strong emphasis</a>
|
|||
|
iff it is part of a [right-flanking delimiter run].</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6932:1-6937:0">
|
|||
|
<p data-sourcepos="6932:5-6936:28">A double <code>__</code> [can close strong emphasis] iff
|
|||
|
it is part of a [right-flanking delimiter run]
|
|||
|
and either (a) not part of a [left-flanking delimiter run]
|
|||
|
or (b) part of a [left-flanking delimiter run]
|
|||
|
followed by punctuation.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6938:1-6947:0">
|
|||
|
<p data-sourcepos="6938:5-6946:19">Emphasis begins with a delimiter that [can open emphasis] and ends
|
|||
|
with a delimiter that [can close emphasis], and that uses the same
|
|||
|
character (<code>_</code> or <code>*</code>) as the opening delimiter. The
|
|||
|
opening and closing delimiters must belong to separate
|
|||
|
[delimiter runs]. If one of the delimiters can both
|
|||
|
open and close emphasis, then the sum of the lengths of the
|
|||
|
delimiter runs containing the opening and closing delimiters
|
|||
|
must not be a multiple of 3 unless both lengths are
|
|||
|
multiples of 3.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6948:1-6958:0">
|
|||
|
<p data-sourcepos="6948:5-6957:23">Strong emphasis begins with a delimiter that
|
|||
|
[can open strong emphasis] and ends with a delimiter that
|
|||
|
[can close strong emphasis], and that uses the same character
|
|||
|
(<code>_</code> or <code>*</code>) as the opening delimiter. The
|
|||
|
opening and closing delimiters must belong to separate
|
|||
|
[delimiter runs]. If one of the delimiters can both open
|
|||
|
and close strong emphasis, then the sum of the lengths of
|
|||
|
the delimiter runs containing the opening and closing
|
|||
|
delimiters must not be a multiple of 3 unless both lengths
|
|||
|
are multiples of 3.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6959:1-6962:0">
|
|||
|
<p data-sourcepos="6959:5-6961:25">A literal <code>*</code> character cannot occur at the beginning or end of
|
|||
|
<code>*</code>-delimited emphasis or <code>**</code>-delimited strong emphasis, unless it
|
|||
|
is backslash-escaped.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6963:1-6966:0">
|
|||
|
<p data-sourcepos="6963:5-6965:25">A literal <code>_</code> character cannot occur at the beginning or end of
|
|||
|
<code>_</code>-delimited emphasis or <code>__</code>-delimited strong emphasis, unless it
|
|||
|
is backslash-escaped.</p>
|
|||
|
</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="6967:1-6968:43" dir="auto">Where rules 1--12 above are compatible with multiple parsings,
|
|||
|
the following principles resolve ambiguity:</p>
|
|||
|
<ol start="13" data-sourcepos="6970:1-6995:0" dir="auto">
|
|||
|
<li data-sourcepos="6970:1-6973:0">
|
|||
|
<p data-sourcepos="6970:5-6972:28">The number of nestings should be minimized. Thus, for example,
|
|||
|
an interpretation <code><strong>...</strong></code> is always preferred to
|
|||
|
<code><em><em>...</em></em></code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6974:1-6976:0">
|
|||
|
<p data-sourcepos="6974:5-6975:49">An interpretation <code><em><strong>...</strong></em></code> is always
|
|||
|
preferred to <code><strong><em>...</em></strong></code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6977:1-6982:0">
|
|||
|
<p data-sourcepos="6977:5-6981:34">When two potential emphasis or strong emphasis spans overlap,
|
|||
|
so that the second begins before the first ends and ends after
|
|||
|
the first ends, the first takes precedence. Thus, for example,
|
|||
|
<code>*foo _bar* baz_</code> is parsed as <code><em>foo _bar</em> baz_</code> rather
|
|||
|
than <code>*foo <em>bar* baz</em></code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6983:1-6988:0">
|
|||
|
<p data-sourcepos="6983:5-6987:49">When there are two potential emphasis or strong emphasis spans
|
|||
|
with the same closing delimiter, the shorter one (the one that
|
|||
|
opens later) takes precedence. Thus, for example,
|
|||
|
<code>**foo **bar baz**</code> is parsed as <code>**foo <strong>bar baz</strong></code>
|
|||
|
rather than <code><strong>foo **bar baz</strong></code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="6989:1-6995:0">
|
|||
|
<p data-sourcepos="6989:5-6994:26">Inline code spans, links, images, and HTML tags group more tightly
|
|||
|
than emphasis. So, when there is a choice between an interpretation
|
|||
|
that contains one of these elements and one that does not, the
|
|||
|
former always wins. Thus, for example, <code>*[foo*](bar)</code> is
|
|||
|
parsed as <code>*<a href="bar">foo*</a></code> rather than as
|
|||
|
<code><em>[foo</em>](bar)</code>.</p>
|
|||
|
</li>
|
|||
|
</ol>
|
|||
|
<p data-sourcepos="6996:1-6996:60" dir="auto">These rules can be illustrated through a series of examples.</p>
|
|||
|
<p data-sourcepos="6998:1-6998:7" dir="auto">Rule 1:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7000:1-7002:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7004:1-7006:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7009:1-7010:66" dir="auto">This is not emphasis, because the opening <code>*</code> is followed by
|
|||
|
whitespace, and hence not part of a [left-flanking delimiter run]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7012:1-7014:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a * foo bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7016:1-7018:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a * foo bar*</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7021:1-7023:44" dir="auto">This is not emphasis, because the opening <code>*</code> is preceded
|
|||
|
by an alphanumeric and followed by punctuation, and hence
|
|||
|
not part of a [left-flanking delimiter run]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7025:1-7027:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a*"foo"*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7029:1-7031:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a*&quot;foo&quot;*</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7034:1-7034:52" dir="auto">Unicode nonbreaking spaces count as whitespace, too:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7036:1-7038:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a *</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7040:1-7042:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>* a *</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7045:1-7045:41" dir="auto">Intraword emphasis with <code>*</code> is permitted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7047:1-7049:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo*bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7051:1-7053:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<em>bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7056:1-7058:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5*6*78</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7060:1-7062:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>5<em>6</em>78</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7065:1-7065:7" dir="auto">Rule 2:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7067:1-7069:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo bar_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7071:1-7073:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7076:1-7077:11" dir="auto">This is not emphasis, because the opening <code>_</code> is followed by
|
|||
|
whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7079:1-7081:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_ foo bar_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7083:1-7085:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_ foo bar_</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7088:1-7089:47" dir="auto">This is not emphasis, because the opening <code>_</code> is preceded
|
|||
|
by an alphanumeric and followed by punctuation:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7091:1-7093:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a_"foo"_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7095:1-7097:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a_&quot;foo&quot;_</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7100:1-7100:46" dir="auto">Emphasis with <code>_</code> is not allowed inside words:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7102:1-7104:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo_bar_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7106:1-7108:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo_bar_</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7111:1-7113:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5_6_78</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7115:1-7117:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>5_6_78</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7120:1-7122:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">пристаням_стремятся_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7124:1-7126:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>пристаням_стремятся_</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7129:1-7130:47" dir="auto">Here <code>_</code> does not generate emphasis, because the first delimiter run
|
|||
|
is right-flanking and the second left-flanking:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7132:1-7134:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aa_"bb"_cc</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7136:1-7138:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aa_&quot;bb&quot;_cc</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7141:1-7143:12" dir="auto">This is emphasis, even though the opening delimiter is
|
|||
|
both left- and right-flanking, because it is preceded by
|
|||
|
punctuation:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7145:1-7147:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo-_(bar)_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7149:1-7151:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo-<em>(bar)</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7154:1-7154:7" dir="auto">Rule 3:</p>
|
|||
|
<p data-sourcepos="7156:1-7157:32" dir="auto">This is not emphasis, because the closing delimiter does
|
|||
|
not match the opening delimiter:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7159:1-7161:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7163:1-7165:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo*</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7168:1-7169:11" dir="auto">This is not emphasis, because the closing <code>*</code> is preceded by
|
|||
|
whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7171:1-7173:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar *</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7175:1-7177:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo bar *</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7180:1-7180:36" dir="auto">A newline also counts as whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7182:1-7185:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7187:1-7190:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7193:1-7195:58" dir="auto">This is not emphasis, because the second <code>*</code> is
|
|||
|
preceded by punctuation and followed by an alphanumeric
|
|||
|
(hence it is not part of a [right-flanking delimiter run]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7197:1-7199:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(*foo)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7201:1-7203:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*(*foo)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7206:1-7207:18" dir="auto">The point of this restriction is more easily appreciated
|
|||
|
with this example:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7209:1-7211:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(*foo*)*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7213:1-7215:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(<em>foo</em>)</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7218:1-7218:39" dir="auto">Intraword emphasis with <code>*</code> is allowed:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7220:1-7222:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo*bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7224:1-7226:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7230:1-7230:7" dir="auto">Rule 4:</p>
|
|||
|
<p data-sourcepos="7232:1-7233:11" dir="auto">This is not emphasis, because the closing <code>_</code> is preceded by
|
|||
|
whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7235:1-7237:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo bar _</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7239:1-7241:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo bar _</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7244:1-7245:56" dir="auto">This is not emphasis, because the second <code>_</code> is
|
|||
|
preceded by punctuation and followed by an alphanumeric:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7247:1-7249:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(_foo)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7251:1-7253:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_(_foo)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7256:1-7256:33" dir="auto">This is emphasis within emphasis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7258:1-7260:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(_foo_)_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7262:1-7264:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(<em>foo</em>)</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7267:1-7267:41" dir="auto">Intraword emphasis is disallowed for <code>_</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7269:1-7271:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo_bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7273:1-7275:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo_bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7278:1-7280:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_пристаням_стремятся</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7282:1-7284:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_пристаням_стремятся</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7287:1-7289:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo_bar_baz_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7291:1-7293:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo_bar_baz</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7296:1-7298:12" dir="auto">This is emphasis, even though the closing delimiter is
|
|||
|
both left- and right-flanking, because it is followed by
|
|||
|
punctuation:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7300:1-7302:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(bar)_.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7304:1-7306:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(bar)</em>.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7309:1-7309:7" dir="auto">Rule 5:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7311:1-7313:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo bar**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7315:1-7317:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo bar</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7320:1-7321:23" dir="auto">This is not strong emphasis, because the opening delimiter is
|
|||
|
followed by whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7323:1-7325:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">** foo bar**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7327:1-7329:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>** foo bar**</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7332:1-7334:44" dir="auto">This is not strong emphasis, because the opening <code>**</code> is preceded
|
|||
|
by an alphanumeric and followed by punctuation, and hence
|
|||
|
not part of a [left-flanking delimiter run]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7336:1-7338:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a**"foo"**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7340:1-7342:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a**&quot;foo&quot;**</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7345:1-7345:49" dir="auto">Intraword strong emphasis with <code>**</code> is permitted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7347:1-7349:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo**bar**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7351:1-7353:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<strong>bar</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7356:1-7356:7" dir="auto">Rule 6:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7358:1-7360:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo bar__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7362:1-7364:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo bar</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7367:1-7368:23" dir="auto">This is not strong emphasis, because the opening delimiter is
|
|||
|
followed by whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7370:1-7372:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__ foo bar__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7374:1-7376:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__ foo bar__</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7379:1-7379:31" dir="auto">A newline counts as whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7380:1-7383:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo bar__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7385:1-7388:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo bar__</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7391:1-7392:47" dir="auto">This is not strong emphasis, because the opening <code>__</code> is preceded
|
|||
|
by an alphanumeric and followed by punctuation:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7394:1-7396:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a__"foo"__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7398:1-7400:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a__&quot;foo&quot;__</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7403:1-7403:49" dir="auto">Intraword strong emphasis is forbidden with <code>__</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7405:1-7407:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo__bar__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7409:1-7411:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo__bar__</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7414:1-7416:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5__6__78</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7418:1-7420:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>5__6__78</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7423:1-7425:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">пристаням__стремятся__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7427:1-7429:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>пристаням__стремятся__</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7432:1-7434:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo, __bar__, baz__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7436:1-7438:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo, <strong>bar</strong>, baz</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7441:1-7443:12" dir="auto">This is strong emphasis, even though the opening delimiter is
|
|||
|
both left- and right-flanking, because it is preceded by
|
|||
|
punctuation:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7445:1-7447:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo-__(bar)__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7449:1-7451:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo-<strong>(bar)</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7455:1-7455:7" dir="auto">Rule 7:</p>
|
|||
|
<p data-sourcepos="7457:1-7458:14" dir="auto">This is not strong emphasis, because the closing delimiter is preceded
|
|||
|
by whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7460:1-7462:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo bar **</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7464:1-7466:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**foo bar **</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7469:1-7470:9" dir="auto">(Nor can it be interpreted as an emphasized <code>*foo bar *</code>, because of
|
|||
|
Rule 11.)</p>
|
|||
|
<p data-sourcepos="7472:1-7473:56" dir="auto">This is not strong emphasis, because the second <code>**</code> is
|
|||
|
preceded by punctuation and followed by an alphanumeric:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7475:1-7477:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**(**foo)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7479:1-7481:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**(**foo)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7484:1-7485:20" dir="auto">The point of this restriction is more easily appreciated
|
|||
|
with these examples:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7487:1-7489:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(**foo**)*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7491:1-7493:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(<strong>foo</strong>)</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7496:1-7499:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**Gomphocarpus (*Gomphocarpus physocarpus*, syn.</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">*Asclepias physocarpa*)**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7501:1-7504:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn.</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><em>Asclepias physocarpa</em>)</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7507:1-7509:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo "*bar*" foo**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7511:1-7513:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo &quot;<em>bar</em>&quot; foo</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7516:1-7516:19" dir="auto">Intraword emphasis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7518:1-7520:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo**bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7522:1-7524:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong>bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7527:1-7527:7" dir="auto">Rule 8:</p>
|
|||
|
<p data-sourcepos="7529:1-7530:23" dir="auto">This is not strong emphasis, because the closing delimiter is
|
|||
|
preceded by whitespace:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7532:1-7534:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo bar __</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7536:1-7538:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__foo bar __</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7541:1-7542:56" dir="auto">This is not strong emphasis, because the second <code>__</code> is
|
|||
|
preceded by punctuation and followed by an alphanumeric:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7544:1-7546:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__(__foo)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7548:1-7550:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__(__foo)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7553:1-7554:18" dir="auto">The point of this restriction is more easily appreciated
|
|||
|
with this example:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7556:1-7558:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(__foo__)_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7560:1-7562:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(<strong>foo</strong>)</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7565:1-7565:49" dir="auto">Intraword strong emphasis is forbidden with <code>__</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7567:1-7569:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7571:1-7573:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__foo__bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7576:1-7578:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__пристаням__стремятся</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7580:1-7582:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__пристаням__стремятся</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7585:1-7587:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__bar__baz__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7589:1-7591:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo__bar__baz</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7594:1-7596:12" dir="auto">This is strong emphasis, even though the closing delimiter is
|
|||
|
both left- and right-flanking, because it is followed by
|
|||
|
punctuation:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7598:1-7600:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__(bar)__.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7602:1-7604:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>(bar)</strong>.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7607:1-7607:7" dir="auto">Rule 9:</p>
|
|||
|
<p data-sourcepos="7609:1-7610:16" dir="auto">Any nonempty sequence of inline elements can be the contents of an
|
|||
|
emphasized span.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7612:1-7614:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [bar](/url)*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7616:1-7618:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <a href="/url">bar</a></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7621:1-7624:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7626:1-7629:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7632:1-7633:16" dir="auto">In particular, emphasis and strong emphasis can be nested
|
|||
|
inside emphasis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7635:1-7637:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo __bar__ baz_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7639:1-7641:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar</strong> baz</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7644:1-7646:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo _bar_ baz_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7648:1-7650:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <em>bar</em> baz</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7653:1-7655:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo_ bar_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7657:1-7659:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><em>foo</em> bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7662:1-7664:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo *bar**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7666:1-7668:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <em>bar</em></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7671:1-7673:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar** baz*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7675:1-7677:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar</strong> baz</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7679:1-7681:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar**baz*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7683:1-7685:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo<strong>bar</strong>baz</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7687:1-7687:51" dir="auto">Note that in the preceding case, the interpretation</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7689:1-7691:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="nt"><p><em></span>foo<span class="nt"></em><em></span>bar<span class="nt"><em></em></span>baz<span class="nt"></em></p></span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7694:1-7699:32" dir="auto">is precluded by the condition that a delimiter that
|
|||
|
can both open and close (like the <code>*</code> after <code>foo</code>)
|
|||
|
cannot form emphasis if the sum of the lengths of
|
|||
|
the delimiter runs containing the opening and
|
|||
|
closing delimiters is a multiple of 3 unless
|
|||
|
both lengths are multiples of 3.</p>
|
|||
|
<p data-sourcepos="7702:1-7703:34" dir="auto">For the same reason, we don't get two consecutive
|
|||
|
emphasis sections in this example:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7705:1-7707:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7709:1-7711:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo**bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7714:1-7717:8" dir="auto">The same condition ensures that the following
|
|||
|
cases are all strong emphasis nested inside
|
|||
|
emphasis, even when the interior spaces are
|
|||
|
omitted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7720:1-7722:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo** bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7724:1-7726:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><strong>foo</strong> bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7729:1-7731:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7733:1-7735:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar</strong></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7738:1-7740:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7742:1-7744:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo<strong>bar</strong></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7747:1-7749:34" dir="auto">When the lengths of the interior closing and opening
|
|||
|
delimiter runs are <em>both</em> multiples of 3, though,
|
|||
|
they can match to create emphasis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7751:1-7753:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo***bar***baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7755:1-7757:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<em><strong>bar</strong></em>baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7759:1-7761:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo******bar*********baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7763:1-7765:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7768:1-7768:42" dir="auto">Indefinite levels of nesting are possible:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7770:1-7772:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar *baz* bim** bop*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7774:1-7776:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7779:1-7781:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [*bar*](/url)*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7783:1-7785:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <a href="/url"><em>bar</em></a></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7788:1-7788:50" dir="auto">There can be no empty emphasis or strong emphasis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7790:1-7792:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">** is not an empty emphasis</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7794:1-7796:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>** is not an empty emphasis</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7799:1-7801:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**** is not an empty strong emphasis</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7803:1-7805:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**** is not an empty strong emphasis</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7809:1-7809:8" dir="auto">Rule 10:</p>
|
|||
|
<p data-sourcepos="7811:1-7812:25" dir="auto">Any nonempty sequence of inline elements can be the contents of an
|
|||
|
strongly emphasized span.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7814:1-7816:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo [bar](/url)**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7818:1-7820:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <a href="/url">bar</a></strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7823:1-7826:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7828:1-7831:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7834:1-7835:23" dir="auto">In particular, emphasis and strong emphasis can be nested
|
|||
|
inside strong emphasis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7837:1-7839:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo _bar_ baz__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7841:1-7843:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <em>bar</em> baz</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7846:1-7848:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo __bar__ baz__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7850:1-7852:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <strong>bar</strong> baz</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7855:1-7857:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo__ bar__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7859:1-7861:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><strong>foo</strong> bar</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7864:1-7866:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo **bar****</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7868:1-7870:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <strong>bar</strong></strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7873:1-7875:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar* baz**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7877:1-7879:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <em>bar</em> baz</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7882:1-7884:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo*bar*baz**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7886:1-7888:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo<em>bar</em>baz</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7891:1-7893:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo* bar**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7895:1-7897:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><em>foo</em> bar</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7900:1-7902:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7904:1-7906:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <em>bar</em></strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7909:1-7909:42" dir="auto">Indefinite levels of nesting are possible:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7911:1-7914:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar **baz**</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bim* bop**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7916:1-7919:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <em>bar <strong>baz</strong></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bim</em> bop</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7922:1-7924:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo [*bar*](/url)**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7926:1-7928:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <a href="/url"><em>bar</em></a></strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7931:1-7931:50" dir="auto">There can be no empty emphasis or strong emphasis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7933:1-7935:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__ is not an empty emphasis</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7937:1-7939:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__ is not an empty emphasis</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7942:1-7944:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____ is not an empty strong emphasis</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7946:1-7948:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>____ is not an empty strong emphasis</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="7952:1-7952:8" dir="auto">Rule 11:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7954:1-7956:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo ***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7958:1-7960:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo ***</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7963:1-7965:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *\**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7967:1-7969:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <em>*</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7972:1-7974:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *_*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7976:1-7978:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <em>_</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7981:1-7983:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *****</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7985:1-7987:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo *****</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7990:1-7992:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo **\***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7994:1-7996:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <strong>*</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="7999:1-8001:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo **_**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8003:1-8005:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <strong>_</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8008:1-8010:32" dir="auto">Note that when delimiters do not match evenly, Rule 11 determines
|
|||
|
that the excess literal <code>*</code> characters will appear outside of the
|
|||
|
emphasis, rather than inside it:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8012:1-8014:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8016:1-8018:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<em>foo</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8021:1-8023:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8025:1-8027:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>*</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8030:1-8032:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8034:1-8036:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<strong>foo</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8039:1-8041:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****foo*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8043:1-8045:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>***<em>foo</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8048:1-8050:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8052:1-8054:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong>*</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8057:1-8059:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo****</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8061:1-8063:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>***</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8067:1-8067:8" dir="auto">Rule 12:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8069:1-8071:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo ___</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8073:1-8075:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo ___</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8078:1-8080:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _\__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8082:1-8084:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <em>_</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8087:1-8089:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _*_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8091:1-8093:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <em>*</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8096:1-8098:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _____</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8100:1-8102:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo _____</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8105:1-8107:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo __\___</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8109:1-8111:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <strong>_</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8114:1-8116:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo __*__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8118:1-8120:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <strong>*</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8123:1-8125:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8127:1-8129:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_<em>foo</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8132:1-8134:32" dir="auto">Note that when delimiters do not match evenly, Rule 12 determines
|
|||
|
that the excess literal <code>_</code> characters will appear outside of the
|
|||
|
emphasis, rather than inside it:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8136:1-8138:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8140:1-8142:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>_</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8145:1-8147:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">___foo__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8149:1-8151:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_<strong>foo</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8154:1-8156:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8158:1-8160:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>___<em>foo</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8163:1-8165:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo___</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8167:1-8169:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong>_</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8172:1-8174:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo____</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8176:1-8178:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>___</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8181:1-8182:44" dir="auto">Rule 13 implies that if you want emphasis nested directly inside
|
|||
|
emphasis, you must use different delimiters:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8184:1-8186:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8188:1-8190:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8193:1-8195:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*_foo_*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8197:1-8199:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><em>foo</em></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8202:1-8204:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8206:1-8208:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8211:1-8213:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_*foo*_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8215:1-8217:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><em>foo</em></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8220:1-8221:21" dir="auto">However, strong emphasis within strong emphasis is possible without
|
|||
|
switching delimiters:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8223:1-8225:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****foo****</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8227:1-8229:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><strong>foo</strong></strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8232:1-8234:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo____</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8236:1-8238:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><strong>foo</strong></strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8242:1-8243:11" dir="auto">Rule 13 can be applied to arbitrarily long sequences of
|
|||
|
delimiters:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8245:1-8247:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">******foo******</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8249:1-8251:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><strong><strong>foo</strong></strong></strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8254:1-8254:8" dir="auto">Rule 14:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8256:1-8258:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo***</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8260:1-8262:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><strong>foo</strong></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8265:1-8267:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_____foo_____</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8269:1-8271:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><strong><strong>foo</strong></strong></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8274:1-8274:8" dir="auto">Rule 15:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8276:1-8278:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo _bar* baz_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8280:1-8282:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo _bar</em> baz_</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8285:1-8287:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo __bar *baz bim__ bam*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8289:1-8291:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar *baz bim</strong> bam</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8294:1-8294:8" dir="auto">Rule 16:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8296:1-8298:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo **bar baz**</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8300:1-8302:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**foo <strong>bar baz</strong></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8305:1-8307:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo *bar baz*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8309:1-8311:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo <em>bar baz</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8314:1-8314:8" dir="auto">Rule 17:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8316:1-8318:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[bar*](/url)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8320:1-8322:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<a href="/url">bar*</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8325:1-8327:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo [bar_](/url)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8329:1-8331:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo <a href="/url">bar_</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8334:1-8336:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*<img src="foo" title="*"/></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8338:1-8340:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<img src="foo" title="*"/></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8343:1-8345:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**<a href="**"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8347:1-8349:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**<a href="**"></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8352:1-8354:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__<a href="__"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8356:1-8358:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__<a href="__"></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8361:1-8363:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*a `*`*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8365:1-8367:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>a <code>*</code></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8370:1-8372:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_a `_`_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8374:1-8376:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>a <code>_</code></em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8379:1-8381:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**a<http://foo.bar/?q=**></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8383:1-8385:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**a<a href="http://foo.bar/?q=**">http://foo.bar/?q=**</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8388:1-8390:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__a<http://foo.bar/?q=__></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8392:1-8394:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__a<a href="http://foo.bar/?q=__">http://foo.bar/?q=__</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div>
|
|||
|
<h2 data-sourcepos="8399:1-8399:28">
|
|||
|
<a id="user-content-strikethrough-extension" class="anchor" href="#strikethrough-extension" aria-hidden="true"></a>Strikethrough (extension)</h2>
|
|||
|
<p data-sourcepos="8401:1-8402:10">GFM enables the <code>strikethrough</code> extension, where an additional emphasis type is
|
|||
|
available.</p>
|
|||
|
<p data-sourcepos="8404:1-8404:59">Strikethrough text is any text wrapped in two tildes (<code>~</code>).</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8406:1-8408:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~Hi~~ Hello, world!</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8410:1-8412:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><del>Hi</del> Hello, world!</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8414:1-8415:17">As with regular emphasis delimiters, a new paragraph will cause strikethrough
|
|||
|
parsing to cease:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8417:1-8421:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This ~~has a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">new paragraph~~.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8423:1-8426:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>This ~~has a</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>new paragraph~~.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="8430:1-8430:8" dir="auto">
|
|||
|
<a id="user-content-links" class="anchor" href="#links" aria-hidden="true"></a>Links</h2>
|
|||
|
<p data-sourcepos="8432:1-8437:13" dir="auto">A link contains [link text] (the visible text), a [link destination]
|
|||
|
(the URI that is the link destination), and optionally a [link title].
|
|||
|
There are two basic kinds of links in Markdown. In [inline links] the
|
|||
|
destination and title are given immediately after the link text. In
|
|||
|
[reference links] the destination and title are defined elsewhere in
|
|||
|
the document.</p>
|
|||
|
<p data-sourcepos="8439:1-8441:22" dir="auto">A <a href="@">link text</a> consists of a sequence of zero or more
|
|||
|
inline elements enclosed by square brackets (<code>[</code> and <code>]</code>). The
|
|||
|
following rules apply:</p>
|
|||
|
<ul data-sourcepos="8443:1-8459:0" dir="auto">
|
|||
|
<li data-sourcepos="8443:1-8446:0">
|
|||
|
<p data-sourcepos="8443:3-8445:43">Links may not contain other links, at any level of nesting. If
|
|||
|
multiple otherwise valid link definitions appear nested inside each
|
|||
|
other, the inner-most definition is used.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="8447:1-8451:0">
|
|||
|
<p data-sourcepos="8447:3-8450:22">Brackets are allowed in the [link text] only if (a) they
|
|||
|
are backslash-escaped or (b) they appear as a matched pair of brackets,
|
|||
|
with an open bracket <code>[</code>, a sequence of zero or more inlines, and
|
|||
|
a close bracket <code>]</code>.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="8452:1-8456:0">
|
|||
|
<p data-sourcepos="8452:3-8455:25">Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly
|
|||
|
than the brackets in link text. Thus, for example,
|
|||
|
<code>[foo`]`</code> could not be a link text, since the second <code>]</code>
|
|||
|
is part of a code span.</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="8457:1-8459:0">
|
|||
|
<p data-sourcepos="8457:3-8458:78">The brackets in link text bind more tightly than markers for
|
|||
|
[emphasis and strong emphasis]. Thus, for example, <code>*[foo*](url)</code> is a link.</p>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="8460:1-8460:42" dir="auto">A <a href="@">link destination</a> consists of either</p>
|
|||
|
<ul data-sourcepos="8462:1-8473:0" dir="auto">
|
|||
|
<li data-sourcepos="8462:1-8465:0">
|
|||
|
<p data-sourcepos="8462:3-8464:27">a sequence of zero or more characters between an opening <code><</code> and a
|
|||
|
closing <code>></code> that contains no line breaks or unescaped
|
|||
|
<code><</code> or <code>></code> characters, or</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="8466:1-8473:0">
|
|||
|
<p data-sourcepos="8466:3-8472:23">a nonempty sequence of characters that does not start with
|
|||
|
<code><</code>, does not include ASCII space or control characters, and
|
|||
|
includes parentheses only if (a) they are backslash-escaped or
|
|||
|
(b) they are part of a balanced pair of unescaped parentheses.
|
|||
|
(Implementations may impose limits on parentheses nesting to
|
|||
|
avoid performance issues, but at least three levels of nesting
|
|||
|
should be supported.)</p>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="8474:1-8474:37" dir="auto">A <a href="@">link title</a> consists of either</p>
|
|||
|
<ul data-sourcepos="8476:1-8487:0" dir="auto">
|
|||
|
<li data-sourcepos="8476:1-8479:0">
|
|||
|
<p data-sourcepos="8476:3-8478:23">a sequence of zero or more characters between straight double-quote
|
|||
|
characters (<code>"</code>), including a <code>"</code> character only if it is
|
|||
|
backslash-escaped, or</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="8480:1-8483:0">
|
|||
|
<p data-sourcepos="8480:3-8482:23">a sequence of zero or more characters between straight single-quote
|
|||
|
characters (<code>'</code>), including a <code>'</code> character only if it is
|
|||
|
backslash-escaped, or</p>
|
|||
|
</li>
|
|||
|
<li data-sourcepos="8484:1-8487:0">
|
|||
|
<p data-sourcepos="8484:3-8486:20">a sequence of zero or more characters between matching parentheses
|
|||
|
(<code>(...)</code>), including a <code>(</code> or <code>)</code> character only if it is
|
|||
|
backslash-escaped.</p>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="8488:1-8489:15" dir="auto">Although [link titles] may span multiple lines, they may not contain
|
|||
|
a [blank line].</p>
|
|||
|
<p data-sourcepos="8491:1-8501:6" dir="auto">An <a href="@">inline link</a> consists of a [link text] followed immediately
|
|||
|
by a left parenthesis <code>(</code>, optional [whitespace], an optional
|
|||
|
[link destination], an optional [link title] separated from the link
|
|||
|
destination by [whitespace], optional [whitespace], and a right
|
|||
|
parenthesis <code>)</code>. The link's text consists of the inlines contained
|
|||
|
in the [link text] (excluding the enclosing square brackets).
|
|||
|
The link's URI consists of the link destination, excluding enclosing
|
|||
|
<code><...></code> if present, with backslash-escapes in effect as described
|
|||
|
above. The link's title consists of the link title, excluding its
|
|||
|
enclosing delimiters, with backslash-escapes in effect as described
|
|||
|
above.</p>
|
|||
|
<p data-sourcepos="8503:1-8503:29" dir="auto">Here is a simple inline link:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8505:1-8507:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/uri "title")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8509:1-8511:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri" title="title">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8514:1-8514:25" dir="auto">The title may be omitted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8516:1-8518:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8520:1-8522:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8525:1-8525:50" dir="auto">Both the title and the destination may be omitted:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8527:1-8529:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]()</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8531:1-8533:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8536:1-8538:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<>)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8540:1-8542:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8544:1-8545:28" dir="auto">The destination can only contain spaces if it is
|
|||
|
enclosed in pointy brackets:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8547:1-8549:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/my uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8551:1-8553:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](/my uri)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8555:1-8557:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](</my uri>)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8559:1-8561:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/my%20uri">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8563:1-8564:36" dir="auto">The destination cannot contain line breaks,
|
|||
|
even if enclosed in pointy brackets:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8566:1-8569:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8571:1-8574:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8576:1-8579:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar>)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8581:1-8584:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](<foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar>)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8586:1-8587:19" dir="auto">The destination can contain <code>)</code> if it is enclosed
|
|||
|
in pointy brackets:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8589:1-8591:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](<b)c>)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8593:1-8595:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="b)c">a</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8597:1-8597:53" dir="auto">Pointy brackets that enclose links must be unescaped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8599:1-8601:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo\>)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8603:1-8605:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](&lt;foo&gt;)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8607:1-8608:24" dir="auto">These are not links, because the opening pointy bracket
|
|||
|
is not matched properly:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8610:1-8614:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](<b)c</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[a](<b)c></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[a](<b>c)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8616:1-8620:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[a](&lt;b)c</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[a](&lt;b)c&gt;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[a](<b>c)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8622:1-8622:55" dir="auto">Parentheses inside the link destination may be escaped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8624:1-8626:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](\(foo\))</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8628:1-8630:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="(foo)">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8632:1-8633:9" dir="auto">Any number of parentheses are allowed without escaping, as long as they are
|
|||
|
balanced:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8635:1-8637:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo(and(bar)))</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8639:1-8641:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo(and(bar))">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8643:1-8644:13" dir="auto">However, if you have unbalanced parentheses, you need to escape or use the
|
|||
|
<code><...></code> form:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8646:1-8648:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\(and\(bar\))</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8650:1-8652:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo(and(bar)">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8655:1-8657:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo(and(bar)>)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8659:1-8661:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo(and(bar)">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8664:1-8665:12" dir="auto">Parentheses and other symbols can also be escaped, as usual
|
|||
|
in Markdown:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8667:1-8669:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\)\:)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8671:1-8673:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo):">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8676:1-8676:52" dir="auto">A link can contain fragment identifiers and queries:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8678:1-8684:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](#fragment)</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[link](http://example.com#fragment)</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">[link](http://example.com?foo=3#frag)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8686:1-8690:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="#fragment">link</a></p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><a href="http://example.com#fragment">link</a></p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p><a href="http://example.com?foo=3#frag">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8693:1-8694:17" dir="auto">Note that a backslash before a non-escapable character is
|
|||
|
just a backslash:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8696:1-8698:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\bar)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8700:1-8702:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo%5Cbar">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8705:1-8712:52" dir="auto">URL-escaping should be left alone inside the destination, as all
|
|||
|
URL-escaped characters are also valid URL characters. Entity and
|
|||
|
numerical character references in the destination will be parsed
|
|||
|
into the corresponding Unicode code points, as usual. These may
|
|||
|
be optionally URL-escaped when written as HTML, but this spec
|
|||
|
does not enforce any particular policy for rendering URLs in
|
|||
|
HTML or other formats. Renderers may make different decisions
|
|||
|
about how to escape or normalize URLs in the output.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8714:1-8716:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo%20b&auml;)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8718:1-8720:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo%20b%C3%A4">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8723:1-8725:23" dir="auto">Note that, because titles can often be parsed as destinations,
|
|||
|
if you try to omit the destination and keep the title, you'll
|
|||
|
get unexpected results:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8727:1-8729:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]("title")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8731:1-8733:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="%22title%22">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8736:1-8736:62" dir="auto">Titles may be in single quotes, double quotes, or parentheses:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8738:1-8742:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title")</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[link](/url 'title')</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[link](/url (title))</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8744:1-8748:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">link</a></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><a href="/url" title="title">link</a></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><a href="/url" title="title">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8751:1-8752:22" dir="auto">Backslash escapes and entity and numeric character references
|
|||
|
may be used in titles:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8754:1-8756:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title \"&quot;")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8758:1-8760:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title &quot;&quot;">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8763:1-8764:64" dir="auto">Titles must be separated from the link using a [whitespace].
|
|||
|
Other [Unicode whitespace] like non-breaking space doesn't work.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8766:1-8768:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8770:1-8772:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url%C2%A0%22title%22">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8775:1-8775:56" dir="auto">Nested balanced quotes are not allowed without escaping:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8777:1-8779:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title "and" title")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8781:1-8783:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](/url &quot;title &quot;and&quot; title&quot;)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8786:1-8786:67" dir="auto">But it is easy to work around this by using a different quote type:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8788:1-8790:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url 'title "and" title')</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8792:1-8794:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title &quot;and&quot; title">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8797:1-8810:61" dir="auto">(Note: <code>Markdown.pl</code> did allow double quotes inside a double-quoted
|
|||
|
title, and its test suite included a test demonstrating this.
|
|||
|
But it is hard to see a good rationale for the extra complexity this
|
|||
|
brings, since there are already many ways---backslash escaping,
|
|||
|
entity and numeric character references, or using a different
|
|||
|
quote type for the enclosing title---to write titles containing
|
|||
|
double quotes. <code>Markdown.pl</code>'s handling of titles has a number
|
|||
|
of other strange features. For example, it allows single-quoted
|
|||
|
titles in inline links, but not reference links. And, in
|
|||
|
reference links but not inline links, it allows a title to begin
|
|||
|
with <code>"</code> and end with <code>)</code>. <code>Markdown.pl</code> 1.0.1 even allows
|
|||
|
titles with no closing quotation mark, though 1.0.2b8 does not.
|
|||
|
It seems preferable to adopt a simple, rational rule that works
|
|||
|
the same way in inline links and link reference definitions.)</p>
|
|||
|
<p data-sourcepos="8812:1-8812:57" dir="auto">[Whitespace] is allowed around the destination and title:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8814:1-8817:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]( /uri</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> "title" )</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8819:1-8821:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri" title="title">link</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8824:1-8825:22" dir="auto">But it is not allowed between the link text and the
|
|||
|
following parenthesis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8827:1-8829:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link] (/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8831:1-8833:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link] (/uri)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8836:1-8837:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones,
|
|||
|
unless they are escaped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8839:1-8841:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [foo [bar]]](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8843:1-8845:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link [foo [bar]]</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8848:1-8850:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link] bar](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8852:1-8854:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link] bar](/uri)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8857:1-8859:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [bar](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8861:1-8863:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link <a href="/uri">bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8866:1-8868:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link \[bar](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8870:1-8872:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link [bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8875:1-8875:41" dir="auto">The link text may contain inline content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8877:1-8879:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link *foo **bar** `#`*](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8881:1-8883:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8886:1-8888:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[![moon](moon.jpg)](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8890:1-8892:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8895:1-8895:68" dir="auto">However, links may not contain other links, at any level of nesting.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8897:1-8899:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo [bar](/uri)](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8901:1-8903:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <a href="/uri">bar</a>](/uri)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8906:1-8908:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *[bar [baz](/uri)](/uri)*](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8910:1-8912:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8915:1-8917:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![[[foo](uri1)](uri2)](uri3)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8919:1-8921:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="uri3" alt="[foo](uri2)" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8924:1-8925:18" dir="auto">These cases illustrate the precedence of link text grouping over
|
|||
|
emphasis grouping:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8927:1-8929:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[foo*](/uri)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8931:1-8933:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<a href="/uri">foo*</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8936:1-8938:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar](baz*)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8940:1-8942:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="baz*">foo *bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8945:1-8946:11" dir="auto">Note that brackets that <em>aren't</em> part of links do not take
|
|||
|
precedence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8948:1-8950:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [bar* baz]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8952:1-8954:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo [bar</em> baz]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8957:1-8958:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans,
|
|||
|
and autolinks over link grouping:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8960:1-8962:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo <bar attr="](baz)"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8964:1-8966:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <bar attr="](baz)"></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8969:1-8971:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo`](/uri)`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8973:1-8975:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo<code>](/uri)</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8978:1-8980:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo<http://example.com/?search=](uri)></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="8982:1-8984:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo<a href="http://example.com/?search=%5D(uri)">http://example.com/?search=](uri)</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="8987:1-8989:41" dir="auto">There are three kinds of <a href="@">reference link</a>s:
|
|||
|
<a href="#full-reference-link">full</a>, <a href="#collapsed-reference-link">collapsed</a>,
|
|||
|
and <a href="#shortcut-reference-link">shortcut</a>.</p>
|
|||
|
<p data-sourcepos="8991:1-8993:71" dir="auto">A <a href="@">full reference link</a>
|
|||
|
consists of a [link text] immediately followed by a [link label]
|
|||
|
that [matches] a [link reference definition] elsewhere in the document.</p>
|
|||
|
<p data-sourcepos="8995:1-9001:9" dir="auto">A <a href="@">link label</a> begins with a left bracket (<code>[</code>) and ends
|
|||
|
with the first right bracket (<code>]</code>) that is not backslash-escaped.
|
|||
|
Between these brackets there must be at least one [non-whitespace character].
|
|||
|
Unescaped square bracket characters are not allowed inside the
|
|||
|
opening and closing square brackets of [link labels]. A link
|
|||
|
label can have at most 999 characters inside the square
|
|||
|
brackets.</p>
|
|||
|
<p data-sourcepos="9003:1-9010:69" dir="auto">One label <a href="@">matches</a>
|
|||
|
another just in case their normalized forms are equal. To normalize a
|
|||
|
label, strip off the opening and closing brackets,
|
|||
|
perform the <em>Unicode case fold</em>, strip leading and trailing
|
|||
|
[whitespace] and collapse consecutive internal
|
|||
|
[whitespace] to a single space. If there are multiple
|
|||
|
matching reference link definitions, the one that comes first in the
|
|||
|
document is used. (It is desirable in such cases to emit a warning.)</p>
|
|||
|
<p data-sourcepos="9012:1-9014:37" dir="auto">The contents of the first link label are parsed as inlines, which are
|
|||
|
used as the link's text. The link's URI and title are provided by the
|
|||
|
matching [link reference definition].</p>
|
|||
|
<p data-sourcepos="9016:1-9016:25" dir="auto">Here is a simple example:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9018:1-9022:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9024:1-9026:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9029:1-9030:22" dir="auto">The rules for the [link text] are the same as with
|
|||
|
[inline links]. Thus:</p>
|
|||
|
<p data-sourcepos="9032:1-9033:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones,
|
|||
|
unless they are escaped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9035:1-9039:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [foo [bar]]][ref]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9041:1-9043:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link [foo [bar]]</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9046:1-9050:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link \[bar][ref]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9052:1-9054:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link [bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9057:1-9057:41" dir="auto">The link text may contain inline content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9059:1-9063:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link *foo **bar** `#`*][ref]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9065:1-9067:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9070:1-9074:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[![moon](moon.jpg)][ref]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9076:1-9078:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9081:1-9081:68" dir="auto">However, links may not contain other links, at any level of nesting.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9083:1-9087:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo [bar](/uri)][ref]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9089:1-9091:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9094:1-9098:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar [baz][ref]*][ref]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9100:1-9102:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9105:1-9106:38" dir="auto">(In the examples above, we have two [shortcut reference links]
|
|||
|
instead of one [full reference link].)</p>
|
|||
|
<p data-sourcepos="9108:1-9109:18" dir="auto">The following cases illustrate the precedence of link text grouping over
|
|||
|
emphasis grouping:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9111:1-9115:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[foo*][ref]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9117:1-9119:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<a href="/uri">foo*</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9122:1-9126:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar][ref]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9128:1-9130:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">foo *bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9133:1-9134:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans,
|
|||
|
and autolinks over link grouping:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9136:1-9140:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo <bar attr="][ref]"></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9142:1-9144:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <bar attr="][ref]"></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9147:1-9151:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo`][ref]`</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9153:1-9155:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo<code>][ref]</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9158:1-9162:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo<http://example.com/?search=][ref]></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9164:1-9166:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9169:1-9169:29" dir="auto">Matching is case-insensitive:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9171:1-9175:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][BaR]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9177:1-9179:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9182:1-9182:26" dir="auto">Unicode case fold is used:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9184:1-9188:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Толпой][Толпой] is a Russian word.</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ТОЛПОЙ]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9190:1-9192:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">Толпой</a> is a Russian word.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9195:1-9196:33" dir="auto">Consecutive internal [whitespace] is treated as one space for
|
|||
|
purposes of determining matching:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9198:1-9203:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> bar]: /url</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[Baz][Foo bar]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9205:1-9207:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">Baz</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9210:1-9211:13" dir="auto">No [whitespace] is allowed between the [link text] and the
|
|||
|
[link label]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9213:1-9217:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] [bar]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9219:1-9221:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo] <a href="/url" title="title">bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9224:1-9229:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[bar]</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9231:1-9234:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><a href="/url" title="title">bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9237:1-9246:9" dir="auto">This is a departure from John Gruber's original Markdown syntax
|
|||
|
description, which explicitly allows whitespace between the link
|
|||
|
text and the link label. It brings reference links in line with
|
|||
|
[inline links], which (according to both original Markdown and
|
|||
|
this spec) cannot have whitespace after the link text. More
|
|||
|
importantly, it prevents inadvertent capture of consecutive
|
|||
|
[shortcut reference links]. If whitespace is allowed between the
|
|||
|
link text and the link label, then in the following we will have
|
|||
|
a single reference link, not two shortcut reference links, as
|
|||
|
intended:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9248:1-9254:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="markdown">[bar]</span>
|
|||
|
<span id="LC3" class="line" lang="markdown"></span>
|
|||
|
<span id="LC4" class="line" lang="markdown"><span class="p">[</span><span class="ss">foo</span><span class="p">]:</span> <span class="sx">/url1</span></span>
|
|||
|
<span id="LC5" class="line" lang="markdown"><span class="p">[</span><span class="ss">bar</span><span class="p">]:</span> <span class="sx">/url2</span></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9256:1-9262:20" dir="auto">(Note that [shortcut reference links] were introduced by Gruber
|
|||
|
himself in a beta version of <code>Markdown.pl</code>, but never included
|
|||
|
in the official syntax description. Without shortcut reference
|
|||
|
links, it is harmless to allow space between the link text and
|
|||
|
link label; but once shortcut references are introduced, it is
|
|||
|
too dangerous to allow this, as it frequently leads to
|
|||
|
unintended results.)</p>
|
|||
|
<p data-sourcepos="9264:1-9265:18" dir="auto">When there are multiple matching [link reference definitions],
|
|||
|
the first is used:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9267:1-9273:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url1</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url2</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">[bar][foo]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9275:1-9277:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url1">bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9280:1-9282:40" dir="auto">Note that matching is performed on normalized strings, not parsed
|
|||
|
inline content. So the following does not match, even though the
|
|||
|
labels define equivalent inline content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9284:1-9288:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[bar][foo\!]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo!]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9290:1-9292:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[bar][foo!]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9295:1-9296:18" dir="auto">[Link labels] cannot contain brackets, unless they are
|
|||
|
backslash-escaped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9298:1-9302:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref[]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref[]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9304:1-9307:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo][ref[]</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>[ref[]: /uri</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9310:1-9314:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref[bar]]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref[bar]]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9316:1-9319:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo][ref[bar]]</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>[ref[bar]]: /uri</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9322:1-9326:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[[foo]]]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[[[foo]]]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9328:1-9331:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[[[foo]]]</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>[[[foo]]]: /url</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9334:1-9338:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref\[]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[ref\[]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9340:1-9342:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9345:1-9345:55" dir="auto">Note that in this example <code>]</code> is not backslash-escaped:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9347:1-9351:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[bar\\]: /uri</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[bar\\]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9353:1-9355:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">bar\</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9358:1-9358:68" dir="auto">A [link label] must contain at least one [non-whitespace character]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9360:1-9364:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9366:1-9369:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[]</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>[]: /uri</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9372:1-9378:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> ]</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> ]: /uri</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9380:1-9385:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">]</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>[</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">]: /uri</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9388:1-9395:40" dir="auto">A <a href="@">collapsed reference link</a>
|
|||
|
consists of a [link label] that [matches] a
|
|||
|
[link reference definition] elsewhere in the
|
|||
|
document, followed by the string <code>[]</code>.
|
|||
|
The contents of the first link label are parsed as inlines,
|
|||
|
which are used as the link's text. The link's URI and title are
|
|||
|
provided by the matching reference link definition. Thus,
|
|||
|
<code>[foo][]</code> is equivalent to <code>[foo][foo]</code>.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9397:1-9401:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9403:1-9405:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9408:1-9412:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[*foo* bar][]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9414:1-9416:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title"><em>foo</em> bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9419:1-9419:37" dir="auto">The link labels are case-insensitive:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9421:1-9425:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo][]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9427:1-9429:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">Foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9433:1-9434:41" dir="auto">As with full reference links, [whitespace] is not
|
|||
|
allowed between the two sets of brackets:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9436:1-9441:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[]</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9443:1-9446:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9449:1-9456:41" dir="auto">A <a href="@">shortcut reference link</a>
|
|||
|
consists of a [link label] that [matches] a
|
|||
|
[link reference definition] elsewhere in the
|
|||
|
document and is not followed by <code>[]</code> or a link label.
|
|||
|
The contents of the first link label are parsed as inlines,
|
|||
|
which are used as the link's text. The link's URI and title
|
|||
|
are provided by the matching link reference definition.
|
|||
|
Thus, <code>[foo]</code> is equivalent to <code>[foo][]</code>.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9458:1-9462:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9464:1-9466:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9469:1-9473:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[*foo* bar]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9475:1-9477:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title"><em>foo</em> bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9480:1-9484:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[*foo* bar]]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9486:1-9488:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9491:1-9495:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[bar [foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9497:1-9499:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[[bar <a href="/url">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9502:1-9502:37" dir="auto">The link labels are case-insensitive:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9504:1-9508:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9510:1-9512:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">Foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9515:1-9515:48" dir="auto">A space after the link text should be preserved:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9517:1-9521:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] bar</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9523:1-9525:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">foo</a> bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9528:1-9529:31" dir="auto">If you just want bracketed text, you can backslash-escape the
|
|||
|
opening bracket to avoid links:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9531:1-9535:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9537:1-9539:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9542:1-9543:26" dir="auto">Note that this is a link, because a link label ends with the first
|
|||
|
following closing bracket:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9545:1-9549:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo*]: /url</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">*[foo*]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9551:1-9553:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<a href="/url">foo*</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9556:1-9557:11" dir="auto">Full and compact references take precedence over shortcut
|
|||
|
references:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9559:1-9564:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[bar]: /url2</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9566:1-9568:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url2">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9570:1-9574:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9576:1-9578:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url1">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9580:1-9580:34" dir="auto">Inline links also take precedence:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9582:1-9586:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]()</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9588:1-9590:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9592:1-9596:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](not a link)</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9598:1-9600:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url1">foo</a>(not a link)</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9602:1-9603:23" dir="auto">In the following case <code>[bar][baz]</code> is parsed as a reference,
|
|||
|
<code>[foo]</code> as normal text:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9605:1-9609:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[baz]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9611:1-9613:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]<a href="/url">bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9616:1-9617:19" dir="auto">Here, though, <code>[foo][bar]</code> is parsed as a reference, since
|
|||
|
<code>[bar]</code> is defined:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9619:1-9624:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[baz]: /url1</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[bar]: /url2</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9626:1-9628:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url2">foo</a><a href="/url1">baz</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9631:1-9632:65" dir="auto">Here <code>[foo]</code> is not parsed as a shortcut reference, because it
|
|||
|
is followed by a link label (even though <code>[bar]</code> is not defined):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9634:1-9639:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[baz]: /url1</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[foo]: /url2</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9641:1-9643:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]<a href="/url1">bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="9647:1-9647:9" dir="auto">
|
|||
|
<a id="user-content-images" class="anchor" href="#images" aria-hidden="true"></a>Images</h2>
|
|||
|
<p data-sourcepos="9649:1-9657:55" dir="auto">Syntax for images is like the syntax for links, with one
|
|||
|
difference. Instead of [link text], we have an
|
|||
|
<a href="@">image description</a>. The rules for this are the
|
|||
|
same as for [link text], except that (a) an
|
|||
|
image description starts with <code>![</code> rather than <code>[</code>, and
|
|||
|
(b) an image description may contain links.
|
|||
|
An image description has inline elements
|
|||
|
as its contents. When an image is rendered to HTML,
|
|||
|
this is standardly used as the image's <code>alt</code> attribute.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9659:1-9661:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](/url "title")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9663:1-9665:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9668:1-9672:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo *bar*]: train.jpg "train & tracks"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9674:1-9676:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9679:1-9681:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo ![bar](/url)](/url2)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9683:1-9685:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url2" alt="foo bar" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9688:1-9690:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo [bar](/url)](/url2)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9692:1-9694:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url2" alt="foo bar" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9697:1-9702:40" dir="auto">Though this spec is concerned with parsing, not rendering, it is
|
|||
|
recommended that in rendering to HTML, only the plain string content
|
|||
|
of the [image description] be used. Note that in
|
|||
|
the above example, the alt attribute's value is <code>foo bar</code>, not <code>foo [bar](/url)</code> or <code>foo <a href="/url">bar</a></code>. Only the plain string
|
|||
|
content is rendered, without formatting.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9704:1-9708:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*][]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo *bar*]: train.jpg "train & tracks"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9710:1-9712:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9715:1-9719:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*][foobar]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[FOOBAR]: train.jpg "train & tracks"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9721:1-9723:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9726:1-9728:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](train.jpg)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9730:1-9732:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9735:1-9737:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">My ![foo bar](/path/to/train.jpg "title" )</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9739:1-9741:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9744:1-9746:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](<url>)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9748:1-9750:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="url" alt="foo" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9753:1-9755:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![](/url)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9757:1-9759:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9762:1-9762:16" dir="auto">Reference-style:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9764:1-9768:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][bar]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[bar]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9770:1-9772:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9775:1-9779:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][bar]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[BAR]: /url</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9781:1-9783:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9786:1-9786:10" dir="auto">Collapsed:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9788:1-9792:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9794:1-9796:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9799:1-9803:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![*foo* bar][]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9805:1-9807:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo bar" title="title" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9810:1-9810:32" dir="auto">The labels are case-insensitive:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9812:1-9816:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![Foo][]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9818:1-9820:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="Foo" title="title" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9823:1-9824:33" dir="auto">As with reference links, [whitespace] is not allowed
|
|||
|
between the two sets of brackets:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9826:1-9831:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo] </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[]</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9833:1-9836:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">[]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9839:1-9839:9" dir="auto">Shortcut:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9841:1-9845:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9847:1-9849:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9852:1-9856:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![*foo* bar]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9858:1-9860:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo bar" title="title" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9863:1-9863:56" dir="auto">Note that link labels cannot contain unescaped brackets:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9865:1-9869:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![[foo]]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[[foo]]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9871:1-9874:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>![[foo]]</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>[[foo]]: /url &quot;title&quot;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9877:1-9877:37" dir="auto">The link labels are case-insensitive:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9879:1-9883:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![Foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9885:1-9887:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="Foo" title="title" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9890:1-9891:33" dir="auto">If you just want a literal <code>!</code> followed by bracketed text, you can
|
|||
|
backslash-escape the opening <code>[</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9893:1-9897:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">!\[foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9899:1-9901:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>![foo]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9904:1-9905:4" dir="auto">If you want a link after a literal <code>!</code>, backslash-escape the
|
|||
|
<code>!</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9907:1-9911:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\![foo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9913:1-9915:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>!<a href="/url" title="title">foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="9918:1-9918:12" dir="auto">
|
|||
|
<a id="user-content-autolinks" class="anchor" href="#autolinks" aria-hidden="true"></a>Autolinks</h2>
|
|||
|
<p data-sourcepos="9920:1-9922:18" dir="auto"><a href="@">Autolink</a>s are absolute URIs and email addresses inside
|
|||
|
<code><</code> and <code>></code>. They are parsed as links, with the URL or email address
|
|||
|
as the link label.</p>
|
|||
|
<p data-sourcepos="9924:1-9926:52" dir="auto">A <a href="@">URI autolink</a> consists of <code><</code>, followed by an
|
|||
|
[absolute URI] followed by <code>></code>. It is parsed as
|
|||
|
a link to the URI, with the URI as the link's label.</p>
|
|||
|
<p data-sourcepos="9928:1-9933:25" dir="auto">An <a href="@">absolute URI</a>,
|
|||
|
for these purposes, consists of a [scheme] followed by a colon (<code>:</code>)
|
|||
|
followed by zero or more characters other than ASCII
|
|||
|
[whitespace] and control characters, <code><</code>, and <code>></code>. If
|
|||
|
the URI includes these characters, they must be percent-encoded
|
|||
|
(e.g. <code>%20</code> for a space).</p>
|
|||
|
<p data-sourcepos="9935:1-9938:37" dir="auto">For purposes of this spec, a <a href="@">scheme</a> is any sequence
|
|||
|
of 2--32 characters beginning with an ASCII letter and followed
|
|||
|
by any combination of ASCII letters, digits, or the symbols plus
|
|||
|
("+"), period ("."), or hyphen ("-").</p>
|
|||
|
<p data-sourcepos="9940:1-9940:30" dir="auto">Here are some valid autolinks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9942:1-9944:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.baz></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9946:1-9948:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9951:1-9953:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.baz/test?q=hello&id=22&boolean></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9955:1-9957:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean">http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9960:1-9962:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><irc://foo.bar:2233/baz></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9964:1-9966:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9969:1-9969:23" dir="auto">Uppercase is also fine:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9971:1-9973:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><MAILTO:FOO@BAR.BAZ></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9975:1-9977:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="9980:1-9983:18" dir="auto">Note that many strings that count as [absolute URIs] for
|
|||
|
purposes of this spec are not valid URIs, because their
|
|||
|
schemes are not registered or because of other problems
|
|||
|
with their syntax:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9985:1-9987:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a+b+c:d></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9989:1-9991:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="a+b+c:d">a+b+c:d</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9994:1-9996:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><made-up-scheme://foo,bar></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="9998:1-10000:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10003:1-10005:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://../></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10007:1-10009:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://../">http://../</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10012:1-10014:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><localhost:5001/foo></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10016:1-10018:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="localhost:5001/foo">localhost:5001/foo</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10021:1-10021:36" dir="auto">Spaces are not allowed in autolinks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10023:1-10025:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar/baz bim></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10027:1-10029:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;http://foo.bar/baz bim&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10032:1-10032:47" dir="auto">Backslash-escapes do not work inside autolinks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10034:1-10036:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://example.com/\[\></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10038:1-10040:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10043:1-10046:55" dir="auto">An <a href="@">email autolink</a>
|
|||
|
consists of <code><</code>, followed by an [email address],
|
|||
|
followed by <code>></code>. The link's label is the email address,
|
|||
|
and the URL is <code>mailto:</code> followed by the email address.</p>
|
|||
|
<p data-sourcepos="10048:1-10051:83" dir="auto">An <a href="@">email address</a>,
|
|||
|
for these purposes, is anything that matches
|
|||
|
the <a href="https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email)" rel="nofollow noreferrer noopener" target="_blank">non-normative regex from the HTML5
|
|||
|
spec</a>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10053:5-10055:0" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10056:1-10056:28" dir="auto">Examples of email autolinks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10058:1-10060:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo@bar.example.com></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10062:1-10064:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10067:1-10069:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo+special@Bar.baz-bar0.com></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10071:1-10073:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10076:1-10076:53" dir="auto">Backslash-escapes do not work inside email autolinks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10078:1-10080:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo\+@bar.example.com></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10082:1-10084:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;foo+@bar.example.com&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10087:1-10087:24" dir="auto">These are not autolinks:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10089:1-10091:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10093:1-10095:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10098:1-10100:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">< http://foo.bar ></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10102:1-10104:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt; http://foo.bar &gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10107:1-10109:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><m:abc></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10111:1-10113:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;m:abc&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10116:1-10118:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo.bar.baz></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10120:1-10122:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;foo.bar.baz&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10125:1-10127:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">http://example.com</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10129:1-10131:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>http://example.com</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10134:1-10136:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo@bar.example.com</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10138:1-10140:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo@bar.example.com</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div>
|
|||
|
<h2 data-sourcepos="10144:1-10144:24">
|
|||
|
<a id="user-content-autolinks-extension" class="anchor" href="#autolinks-extension" aria-hidden="true"></a>Autolinks (extension)</h2>
|
|||
|
<p data-sourcepos="10146:1-10147:29">GFM enables the <code>autolink</code> extension, where autolinks will be recognised in a
|
|||
|
greater number of conditions.</p>
|
|||
|
<p data-sourcepos="10149:1-10153:8">[Autolink]s can also be constructed without requiring the use of <code><</code> and to <code>></code>
|
|||
|
to delimit them, although they will be recognized under a smaller set of
|
|||
|
circumstances. All such recognized autolinks can only come at the beginning of
|
|||
|
a line, after whitespace, or any of the delimiting characters <code>*</code>, <code>_</code>, <code>~</code>,
|
|||
|
and <code>(</code>.</p>
|
|||
|
<p data-sourcepos="10155:1-10161:73">An <a href="@">extended www autolink</a> will be recognized
|
|||
|
when the text <code>www.</code> is found followed by a [valid domain].
|
|||
|
A <a href="@">valid domain</a> consists of segments
|
|||
|
of alphanumeric characters, underscores (<code>_</code>) and hyphens (<code>-</code>)
|
|||
|
separated by periods (<code>.</code>).
|
|||
|
There must be at least one period,
|
|||
|
and no underscores may be present in the last two segments of the domain.</p>
|
|||
|
<p data-sourcepos="10163:1-10163:49">The scheme <code>http</code> will be inserted automatically:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10165:1-10167:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.commonmark.org</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10169:1-10171:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.commonmark.org">www.commonmark.org</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10173:1-10173:77">After a [valid domain], zero or more non-space non-<code><</code> characters may follow:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10175:1-10177:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Visit www.commonmark.org/help for more information.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10179:1-10181:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10183:1-10183:64">We then apply <a href="@">extended autolink path validation</a> as follows:</p>
|
|||
|
<p data-sourcepos="10185:1-10187:21">Trailing punctuation (specifically, <code>?</code>, <code>!</code>, <code>.</code>, <code>,</code>, <code>:</code>, <code>*</code>, <code>_</code>, and <code>~</code>)
|
|||
|
will not be considered part of the autolink, though they may be included in the
|
|||
|
interior of the link:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10189:1-10193:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Visit www.commonmark.org.</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">Visit www.commonmark.org/a.b.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10195:1-10198:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org">www.commonmark.org</a>.</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10200:1-10203:76">When an autolink ends in <code>)</code>, we scan the entire autolink for the total number
|
|||
|
of parentheses. If there is a greater number of closing parentheses than
|
|||
|
opening ones, we don't consider the unmatched trailing parentheses part of the
|
|||
|
autolink, in order to facilitate including an autolink inside a parenthesis:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10205:1-10213:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=Markup+(business)</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">www.google.com/search?q=Markup+(business)))</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">(www.google.com/search?q=Markup+(business))</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">(www.google.com/search?q=Markup+(business)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10215:1-10220:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>))</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>)</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10222:1-10224:8">This check is only done when the link ends in a closing parentheses <code>)</code>, so if
|
|||
|
the only parentheses are in the interior of the autolink, no special rules are
|
|||
|
applied:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10226:1-10228:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=(business))+ok</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10230:1-10232:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=(business))+ok">www.google.com/search?q=(business))+ok</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10234:1-10237:13">If an autolink ends in a semicolon (<code>;</code>), we check to see if it appears to
|
|||
|
resemble an [entity reference][entity references]; if the preceding text is <code>&</code>
|
|||
|
followed by one or more alphanumeric characters. If so, it is excluded from
|
|||
|
the autolink:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10239:1-10243:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=commonmark&hl=en</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">www.google.com/search?q=commonmark&hl;</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10245:1-10248:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=commonmark&amp;hl=en">www.google.com/search?q=commonmark&amp;hl=en</a></p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=commonmark">www.google.com/search?q=commonmark</a>&amp;hl;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10250:1-10250:33"><code><</code> immediately ends an autolink.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10252:1-10254:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.commonmark.org/he<lp</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10256:1-10258:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.commonmark.org/he">www.commonmark.org/he</a>&lt;lp</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10260:1-10263:36">An <a href="@">extended url autolink</a> will be recognised when one of the schemes
|
|||
|
<code>http://</code>, <code>https://</code>, or <code>ftp://</code>, followed by a [valid domain], then zero or
|
|||
|
more non-space non-<code><</code> characters according to
|
|||
|
[extended autolink path validation]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10265:1-10271:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">http://commonmark.org</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">(Visit https://encrypted.google.com/search?q=Markup+(business))</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">Anonymous FTP is available at ftp://foo.bar.baz.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10273:1-10277:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://commonmark.org">http://commonmark.org</a></p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10280:1-10282:20">An <a href="@">extended email autolink</a> will be recognised when an email address is
|
|||
|
recognised within any text node. Email addresses are recognised according to
|
|||
|
the following rules:</p>
|
|||
|
<ul data-sourcepos="10284:1-10290:0">
|
|||
|
<li data-sourcepos="10284:1-10284:75">One ore more characters which are alphanumeric, or <code>.</code>, <code>-</code>, <code>_</code>, or <code>+</code>.</li>
|
|||
|
<li data-sourcepos="10285:1-10285:16">An <code>@</code> symbol.</li>
|
|||
|
<li data-sourcepos="10286:1-10290:0">One or more characters which are alphanumeric, or <code>-</code> or <code>_</code>,
|
|||
|
separated by periods (<code>.</code>).
|
|||
|
There must be at least one period.
|
|||
|
The last character must not be one of <code>-</code> or <code>_</code>.</li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="10291:1-10291:71">The scheme <code>mailto:</code> will automatically be added to the generated link:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10293:1-10295:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo@bar.baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10297:1-10299:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="mailto:foo@bar.baz">foo@bar.baz</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10301:1-10301:44"><code>+</code> can occur before the <code>@</code>, but not after.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10303:1-10305:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10307:1-10309:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>hello@mail+xyz.example isn't valid, but <a href="mailto:hello+xyz@mail.example">hello+xyz@mail.example</a> is.</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10311:1-10313:12"><code>.</code>, <code>-</code>, and <code>_</code> can occur on both sides of the <code>@</code>, but only <code>.</code> may occur at
|
|||
|
the end of the email address, in which case it will not be considered part of
|
|||
|
the address:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10315:1-10323:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a.b-c_d@a.b</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">a.b-c_d@a.b.</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">a.b-c_d@a.b-</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">a.b-c_d@a.b_</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10325:1-10330:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a></p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a>.</p></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p>a.b-c_d@a.b-</p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><p>a.b-c_d@a.b_</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="10334:1-10334:11" dir="auto">
|
|||
|
<a id="user-content-raw-html" class="anchor" href="#raw-html" aria-hidden="true"></a>Raw HTML</h2>
|
|||
|
<p data-sourcepos="10336:1-10339:57" dir="auto">Text between <code><</code> and <code>></code> that looks like an HTML tag is parsed as a
|
|||
|
raw HTML tag and will be rendered in HTML without escaping.
|
|||
|
Tag and attribute names are not limited to current HTML tags,
|
|||
|
so custom tags (and even, say, DocBook tags) may be used.</p>
|
|||
|
<p data-sourcepos="10341:1-10341:29" dir="auto">Here is the grammar for tags:</p>
|
|||
|
<p data-sourcepos="10343:1-10345:14" dir="auto">A <a href="@">tag name</a> consists of an ASCII letter
|
|||
|
followed by zero or more ASCII letters, digits, or
|
|||
|
hyphens (<code>-</code>).</p>
|
|||
|
<p data-sourcepos="10347:1-10349:32" dir="auto">An <a href="@">attribute</a> consists of [whitespace],
|
|||
|
an [attribute name], and an optional
|
|||
|
[attribute value specification].</p>
|
|||
|
<p data-sourcepos="10351:1-10354:52" dir="auto">An <a href="@">attribute name</a>
|
|||
|
consists of an ASCII letter, <code>_</code>, or <code>:</code>, followed by zero or more ASCII
|
|||
|
letters, digits, <code>_</code>, <code>.</code>, <code>:</code>, or <code>-</code>. (Note: This is the XML
|
|||
|
specification restricted to ASCII. HTML5 is laxer.)</p>
|
|||
|
<p data-sourcepos="10356:1-10359:7" dir="auto">An <a href="@">attribute value specification</a>
|
|||
|
consists of optional [whitespace],
|
|||
|
a <code>=</code> character, optional [whitespace], and an [attribute
|
|||
|
value].</p>
|
|||
|
<p data-sourcepos="10361:1-10363:72" dir="auto">An <a href="@">attribute value</a>
|
|||
|
consists of an [unquoted attribute value],
|
|||
|
a [single-quoted attribute value], or a [double-quoted attribute value].</p>
|
|||
|
<p data-sourcepos="10365:1-10367:60" dir="auto">An <a href="@">unquoted attribute value</a>
|
|||
|
is a nonempty string of characters not
|
|||
|
including [whitespace], <code>"</code>, <code>'</code>, <code>=</code>, <code><</code>, <code>></code>, or <code>`</code>.</p>
|
|||
|
<p data-sourcepos="10369:1-10371:46" dir="auto">A <a href="@">single-quoted attribute value</a>
|
|||
|
consists of <code>'</code>, zero or more
|
|||
|
characters not including <code>'</code>, and a final <code>'</code>.</p>
|
|||
|
<p data-sourcepos="10373:1-10375:46" dir="auto">A <a href="@">double-quoted attribute value</a>
|
|||
|
consists of <code>"</code>, zero or more
|
|||
|
characters not including <code>"</code>, and a final <code>"</code>.</p>
|
|||
|
<p data-sourcepos="10377:1-10379:31" dir="auto">An <a href="@">open tag</a> consists of a <code><</code> character, a [tag name],
|
|||
|
zero or more [attributes], optional [whitespace], an optional <code>/</code>
|
|||
|
character, and a <code>></code> character.</p>
|
|||
|
<p data-sourcepos="10381:1-10382:57" dir="auto">A <a href="@">closing tag</a> consists of the string <code></</code>, a
|
|||
|
[tag name], optional [whitespace], and the character <code>></code>.</p>
|
|||
|
<p data-sourcepos="10384:1-10387:63" dir="auto">An <a href="@">HTML comment</a> consists of <code><!--</code> + <em>text</em> + <code>--></code>,
|
|||
|
where <em>text</em> does not start with <code>></code> or <code>-></code>, does not end with <code>-</code>,
|
|||
|
and does not contain <code>--</code>. (See the
|
|||
|
<a href="http://www.w3.org/TR/html5/syntax.html#comments" rel="nofollow noreferrer noopener" target="_blank">HTML5 spec</a>.)</p>
|
|||
|
<p data-sourcepos="10389:1-10392:5" dir="auto">A <a href="@">processing instruction</a>
|
|||
|
consists of the string <code><?</code>, a string
|
|||
|
of characters not including the string <code>?></code>, and the string
|
|||
|
<code>?></code>.</p>
|
|||
|
<p data-sourcepos="10394:1-10397:37" dir="auto">A <a href="@">declaration</a> consists of the
|
|||
|
string <code><!</code>, a name consisting of one or more uppercase ASCII letters,
|
|||
|
[whitespace], a string of characters not including the
|
|||
|
character <code>></code>, and the character <code>></code>.</p>
|
|||
|
<p data-sourcepos="10399:1-10401:28" dir="auto">A <a href="@">CDATA section</a> consists of
|
|||
|
the string <code><![CDATA[</code>, a string of characters not including the string
|
|||
|
<code>]]></code>, and the string <code>]]></code>.</p>
|
|||
|
<p data-sourcepos="10403:1-10405:21" dir="auto">An <a href="@">HTML tag</a> consists of an [open tag], a [closing tag],
|
|||
|
an [HTML comment], a [processing instruction], a [declaration],
|
|||
|
or a [CDATA section].</p>
|
|||
|
<p data-sourcepos="10407:1-10407:31" dir="auto">Here are some simple open tags:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10409:1-10411:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a><bab><c2c></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10413:1-10415:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a><bab><c2c></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10418:1-10418:15" dir="auto">Empty elements:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10420:1-10422:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a/><b2/></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10424:1-10426:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a/><b2/></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10429:1-10429:24" dir="auto">[Whitespace] is allowed:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10431:1-10434:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a /><b2</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">data="foo" ></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10436:1-10439:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a /><b2</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">data="foo" ></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10442:1-10442:16" dir="auto">With attributes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10444:1-10447:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a foo="bar" bam = 'baz <em>"</em>'</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">_boolean zoop:33=zoop:33 /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10449:1-10452:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a foo="bar" bam = 'baz <em>"</em>'</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">_boolean zoop:33=zoop:33 /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10455:1-10455:29" dir="auto">Custom tag names can be used:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10457:1-10459:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo <responsive-image src="foo.jpg" /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10461:1-10463:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo <responsive-image src="foo.jpg" /></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10466:1-10466:38" dir="auto">Illegal tag names, not parsed as HTML:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10468:1-10470:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><33> <__></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10472:1-10474:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;33&gt; &lt;__&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10477:1-10477:24" dir="auto">Illegal attribute names:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10479:1-10481:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a h*#ref="hi"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10483:1-10485:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;a h*#ref=&quot;hi&quot;&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10488:1-10488:25" dir="auto">Illegal attribute values:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10490:1-10492:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="hi'> <a href=hi'></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10494:1-10496:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;a href=&quot;hi'&gt; &lt;a href=hi'&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10499:1-10499:21" dir="auto">Illegal [whitespace]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10501:1-10506:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">< a><</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo><bar/ ></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><foo bar=baz</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">bim!bop /></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10508:1-10513:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt; a&gt;&lt;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">foo&gt;&lt;bar/ &gt;</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">&lt;foo bar=baz</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">bim!bop /&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10516:1-10516:21" dir="auto">Missing [whitespace]:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10518:1-10520:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href='bar'title=title></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10522:1-10524:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;a href='bar'title=title&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10527:1-10527:13" dir="auto">Closing tags:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10529:1-10531:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></a></foo ></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10533:1-10535:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p></a></foo ></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10538:1-10538:34" dir="auto">Illegal attributes in closing tag:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10540:1-10542:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></a href="foo"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10544:1-10546:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;/a href=&quot;foo&quot;&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10549:1-10549:9" dir="auto">Comments:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10551:1-10554:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!-- this is a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">comment - with hyphen --></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10556:1-10559:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <!-- this is a</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">comment - with hyphen --></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10562:1-10564:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!-- not a comment -- two hyphens --></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10566:1-10568:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo &lt;!-- not a comment -- two hyphens --&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10571:1-10571:13" dir="auto">Not comments:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10573:1-10577:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!--> foo --></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">foo <!-- foo---></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10579:1-10582:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo &lt;!--&gt; foo --&gt;</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>foo &lt;!-- foo---&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10585:1-10585:24" dir="auto">Processing instructions:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10587:1-10589:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <?php echo $a; ?></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10591:1-10593:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <?php echo $a; ?></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10596:1-10596:13" dir="auto">Declarations:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10598:1-10600:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!ELEMENT br EMPTY></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10602:1-10604:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <!ELEMENT br EMPTY></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10607:1-10607:15" dir="auto">CDATA sections:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10609:1-10611:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <![CDATA[>&<]]></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10613:1-10615:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <![CDATA[>&<]]></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10618:1-10619:11" dir="auto">Entity and numeric character references are preserved in HTML
|
|||
|
attributes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10621:1-10623:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <a href="&ouml;"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10625:1-10627:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <a href="&ouml;"></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10630:1-10630:49" dir="auto">Backslash escapes do not work in HTML attributes:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10632:1-10634:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <a href="\*"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10636:1-10638:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <a href="\*"></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10641:1-10643:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="\""></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10645:1-10647:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;a href=&quot;&quot;&quot;&gt;</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div>
|
|||
|
<h2 data-sourcepos="10652:1-10652:34">
|
|||
|
<a id="user-content-disallowed-raw-html-extension" class="anchor" href="#disallowed-raw-html-extension" aria-hidden="true"></a>Disallowed Raw HTML (extension)</h2>
|
|||
|
<p data-sourcepos="10654:1-10655:36">GFM enables the <code>tagfilter</code> extension, where the following HTML tags will be
|
|||
|
filtered when rendering HTML output:</p>
|
|||
|
<ul data-sourcepos="10657:1-10666:0">
|
|||
|
<li data-sourcepos="10657:1-10657:11"><code><title></code></li>
|
|||
|
<li data-sourcepos="10658:1-10658:14"><code><textarea></code></li>
|
|||
|
<li data-sourcepos="10659:1-10659:11"><code><style></code></li>
|
|||
|
<li data-sourcepos="10660:1-10660:9"><code><xmp></code></li>
|
|||
|
<li data-sourcepos="10661:1-10661:12"><code><iframe></code></li>
|
|||
|
<li data-sourcepos="10662:1-10662:13"><code><noembed></code></li>
|
|||
|
<li data-sourcepos="10663:1-10663:14"><code><noframes></code></li>
|
|||
|
<li data-sourcepos="10664:1-10664:12"><code><script></code></li>
|
|||
|
<li data-sourcepos="10665:1-10666:0"><code><plaintext></code></li>
|
|||
|
</ul>
|
|||
|
<p data-sourcepos="10667:1-10670:71">Filtering is done by replacing the leading <code><</code> with the entity <code>&lt;</code>. These
|
|||
|
tags are chosen in particular as they change how HTML is interpreted in a way
|
|||
|
unique to them (i.e. nested HTML is interpreted differently), and this is
|
|||
|
usually undesireable in the context of other rendered Markdown content.</p>
|
|||
|
<p data-sourcepos="10672:1-10672:39">All other HTML tags are left untouched.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10674:1-10680:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><strong> <title> <style> <em></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> <xmp> is disallowed. <XMP> is also disallowed.</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10682:1-10687:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong> &lt;title> &lt;style> <em></p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><blockquote></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> &lt;xmp> is disallowed. &lt;XMP> is also disallowed.</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="10691:1-10691:19" dir="auto">
|
|||
|
<a id="user-content-hard-line-breaks" class="anchor" href="#hard-line-breaks" aria-hidden="true"></a>Hard line breaks</h2>
|
|||
|
<p data-sourcepos="10693:1-10696:27" dir="auto">A line break (not in a code span or HTML tag) that is preceded
|
|||
|
by two or more spaces and does not occur at the end of a block
|
|||
|
is parsed as a <a href="@">hard line break</a> (rendered
|
|||
|
in HTML as a <code><br /></code> tag):</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10698:1-10701:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10703:1-10706:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10709:1-10710:48" dir="auto">For a more visible alternative, a backslash before the
|
|||
|
[line ending] may be used instead of two spaces:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10712:1-10715:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10717:1-10720:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10723:1-10723:33" dir="auto">More than two spaces can be used:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10725:1-10728:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10730:1-10733:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10736:1-10736:61" dir="auto">Leading spaces at the beginning of the next line are ignored:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10738:1-10741:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10743:1-10746:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10749:1-10752:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> bar</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10754:1-10757:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10760:1-10761:26" dir="auto">Line breaks can occur inside emphasis, links, and other constructs
|
|||
|
that allow inline content:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10763:1-10766:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10768:1-10771:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10774:1-10777:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo\</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar*</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10779:1-10782:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo<br /></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar</em></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10785:1-10785:42" dir="auto">Line breaks do not occur inside code spans</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10787:1-10790:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`code </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">span`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10792:1-10794:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>code span</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10797:1-10800:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`code\</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">span`</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10802:1-10804:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>code\ span</code></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10807:1-10807:13" dir="auto">or HTML tags:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10809:1-10812:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10814:1-10817:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar"></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10820:1-10823:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo\</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar"></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10825:1-10828:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo\</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">bar"></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10831:1-10833:20" dir="auto">Hard line breaks are for separating inline content within a block.
|
|||
|
Neither syntax for hard line breaks works at the end of a paragraph or
|
|||
|
other block element:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10835:1-10837:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10839:1-10841:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo\</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10844:1-10846:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10848:1-10850:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10853:1-10855:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo\</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10857:1-10859:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo\</h3></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10862:1-10864:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo </span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10866:1-10868:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo</h3></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="10871:1-10871:19" dir="auto">
|
|||
|
<a id="user-content-soft-line-breaks" class="anchor" href="#soft-line-breaks" aria-hidden="true"></a>Soft line breaks</h2>
|
|||
|
<p data-sourcepos="10873:1-10877:62" dir="auto">A regular line break (not in a code span or HTML tag) that is not
|
|||
|
preceded by two or more spaces or a backslash is parsed as a
|
|||
|
<a href="@">softbreak</a>. (A softbreak may be rendered in HTML either as a
|
|||
|
[line ending] or as a space. The result will be the same in
|
|||
|
browsers. In the examples here, a [line ending] will be used.)</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10879:1-10882:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10884:1-10887:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10890:1-10891:8" dir="auto">Spaces at the end of the line and beginning of the next line are
|
|||
|
removed:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10893:1-10896:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> baz</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10898:1-10901:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10904:1-10905:25" dir="auto">A conforming parser may render a soft line break in HTML either as a
|
|||
|
line break or as a space.</p>
|
|||
|
<p data-sourcepos="10907:1-10908:20" dir="auto">A renderer may also provide an option to render soft line breaks
|
|||
|
as hard line breaks.</p>
|
|||
|
<h2 data-sourcepos="10910:1-10910:18" dir="auto">
|
|||
|
<a id="user-content-textual-content" class="anchor" href="#textual-content" aria-hidden="true"></a>Textual content</h2>
|
|||
|
<p data-sourcepos="10912:1-10913:35" dir="auto">Any characters not given an interpretation by the above rules will
|
|||
|
be parsed as plain textual content.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10915:1-10917:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">hello $.;'there</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10919:1-10921:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>hello $.;'there</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10924:1-10926:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo χρῆν</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10928:1-10930:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo χρῆν</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="10933:1-10933:39" dir="auto">Internal spaces are preserved verbatim:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10935:1-10937:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Multiple spaces</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10939:1-10941:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Multiple spaces</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h1 data-sourcepos="10944:1-10944:40" dir="auto">
|
|||
|
<a id="user-content-gitlab-official-specification-markdown" class="anchor" href="#gitlab-official-specification-markdown" aria-hidden="true"></a>GitLab Official Specification Markdown</h1>
|
|||
|
<p data-sourcepos="10946:1-10949:104" dir="auto">Currently, only some of the GitLab-specific markdown features are
|
|||
|
listed in this section. We may eventually add all
|
|||
|
GitLab-specific features currently listed as supported in the
|
|||
|
<a href="https://docs.gitlab.com/ee/user/markdown.html" rel="nofollow noreferrer noopener" target="_blank">user-facing documentation for GitLab Flavored Markdown</a>.</p>
|
|||
|
<p data-sourcepos="10951:1-10952:69" dir="auto">There is currently only this single top-level heading, but the
|
|||
|
examples may be split into multiple top-level headings in the future.</p>
|
|||
|
<h2 data-sourcepos="10954:1-10954:12" dir="auto">
|
|||
|
<a id="user-content-footnotes" class="anchor" href="#footnotes" aria-hidden="true"></a>Footnotes</h2>
|
|||
|
<p data-sourcepos="10956:1-10957:143" dir="auto">See
|
|||
|
<a href="https://docs.gitlab.com/ee/user/markdown.html#footnotes" rel="nofollow noreferrer noopener" target="_blank">the footnotes section of the user-facing documentation for GitLab Flavored Markdown</a>.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10959:1-10963:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">footnote reference tag [^fortytwo]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">[^fortytwo]: footnote text</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="10965:1-10985:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">footnote reference tag</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><sup></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">1</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></a></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></sup></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></p></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><section data-footnotes></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><ol></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext"><li id="fn-fortytwo-42"></span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"><p></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext">footnote text</span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"><a href="#fnref-fortytwo-42" data-footnote-backref></span>
|
|||
|
<span id="LC15" class="line" lang="plaintext"></a></span>
|
|||
|
<span id="LC16" class="line" lang="plaintext"></p></span>
|
|||
|
<span id="LC17" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC18" class="line" lang="plaintext"></ol></span>
|
|||
|
<span id="LC19" class="line" lang="plaintext"></section></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="10987:1-10987:18" dir="auto">
|
|||
|
<a id="user-content-task-list-items" class="anchor" href="#task-list-items" aria-hidden="true"></a>Task list items</h2>
|
|||
|
<p data-sourcepos="10989:1-10990:117" dir="auto">See
|
|||
|
<a href="https://docs.gitlab.com/ee/user/markdown.html#task-lists" rel="nofollow noreferrer noopener" target="_blank">Task lists</a> in the GitLab Flavored Markdown documentation.</p>
|
|||
|
<p data-sourcepos="10992:1-10995:39" dir="auto">Task list items (checkboxes) are defined as a GitHub Flavored Markdown extension in a section above.
|
|||
|
GitLab extends the behavior of task list items to support additional features.
|
|||
|
Some of these features are in-progress, and should not yet be considered part of the official
|
|||
|
GitLab Flavored Markdown specification.</p>
|
|||
|
<p data-sourcepos="10997:1-10997:85" dir="auto">Some of the behavior of task list items is implemented as client-side JavaScript/CSS.</p>
|
|||
|
<p data-sourcepos="10999:1-10999:80" dir="auto">The following are some basic examples; more examples may be added in the future.</p>
|
|||
|
<p data-sourcepos="11001:1-11001:16" dir="auto">Incomplete task:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11003:1-11005:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] incomplete</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11007:1-11015:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><task-button/></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><input type="checkbox" disabled/></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">incomplete</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11017:1-11017:15" dir="auto">Completed task:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11019:1-11021:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [x] completed</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11023:1-11031:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><task-button/></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><input type="checkbox" checked disabled/></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">completed</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11033:1-11033:18" dir="auto">Inapplicable task:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11035:1-11037:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11039:1-11049:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><task-button/></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><s></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext">inapplicable</span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></s></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11051:1-11052:50" dir="auto">Inapplicable task in a "loose" list. Note that the <code><del></code> tag is not applied to the
|
|||
|
loose text; it has strikethrough applied with CSS.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11054:1-11058:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> text in loose list</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11060:1-11075:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><li></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><p></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"><task-button/></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><s></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext">inapplicable</span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></s></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"></p></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><p></span>
|
|||
|
<span id="LC11" class="line" lang="plaintext">text in loose list</span>
|
|||
|
<span id="LC12" class="line" lang="plaintext"></p></span>
|
|||
|
<span id="LC13" class="line" lang="plaintext"></li></span>
|
|||
|
<span id="LC14" class="line" lang="plaintext"></ul></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="11077:1-11077:15" dir="auto">
|
|||
|
<a id="user-content-front-matter" class="anchor" href="#front-matter" aria-hidden="true"></a>Front matter</h2>
|
|||
|
<p data-sourcepos="11079:1-11080:121" dir="auto">See
|
|||
|
<a href="https://docs.gitlab.com/ee/user/markdown.html#front-matter" rel="nofollow noreferrer noopener" target="_blank">Front matter</a> in the GitLab Flavored Markdown documentation.</p>
|
|||
|
<p data-sourcepos="11082:1-11083:95" dir="auto">Front matter is metadata included at the beginning of a Markdown document, preceding the content.
|
|||
|
This data can be used by static site generators like Jekyll, Hugo, and many other applications.</p>
|
|||
|
<p data-sourcepos="11085:1-11085:18" dir="auto">YAML front matter:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11087:1-11091:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">title: YAML front matter</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11093:1-11099:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><code></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">title: YAML front matter</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11101:1-11101:18" dir="auto">TOML front matter:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11103:1-11107:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">title: TOML front matter</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">+++</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11109:1-11115:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><code></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">title: TOML front matter</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></code></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11117:1-11117:18" dir="auto">JSON front matter:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11119:1-11125:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">;;;</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">{</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> "title": "JSON front matter"</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">}</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">;;;</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11127:1-11135:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><code></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">{</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> "title": "JSON front matter"</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">}</span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"></code></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"></pre></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11137:1-11137:66" dir="auto">Front matter blocks should be inserted at the top of the document:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11139:1-11145:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">text</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">---</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">title: YAML front matter</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11147:1-11151:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>text</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><hr></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11153:1-11153:74" dir="auto">Front matter block delimiters shouldn’t be preceded by space characters:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11155:1-11159:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ---</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">title: YAML front matter</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">---</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11161:1-11164:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="11166:1-11166:20" dir="auto">
|
|||
|
<a id="user-content-table-of-contents" class="anchor" href="#table-of-contents" aria-hidden="true"></a>Table of contents</h2>
|
|||
|
<p data-sourcepos="11168:1-11170:46" dir="auto">See
|
|||
|
<a href="https://docs.gitlab.com/ee/user/markdown.html#table-of-contents" rel="nofollow noreferrer noopener" target="_blank">table of contents</a>
|
|||
|
in the GitLab Flavored Markdown documentation.</p>
|
|||
|
<p data-sourcepos="11172:1-11173:58" dir="auto">A table of contents is an unordered list that links to subheadings in the document.
|
|||
|
Add either the <code>[[_TOC_]]</code> or </p><ul class="section-nav">
|
|||
|
<li>
|
|||
|
<a href="#preliminaries">Preliminaries</a><ul>
|
|||
|
<li><a href="#characters-and-lines">Characters and lines</a></li>
|
|||
|
<li><a href="#tabs">Tabs</a></li>
|
|||
|
<li><a href="#insecure-characters">Insecure characters</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<a href="#blocks-and-inlines">Blocks and inlines</a><ul>
|
|||
|
<li><a href="#precedence">Precedence</a></li>
|
|||
|
<li><a href="#container-blocks-and-leaf-blocks">Container blocks and leaf blocks</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<a href="#leaf-blocks">Leaf blocks</a><ul>
|
|||
|
<li><a href="#thematic-breaks">Thematic breaks</a></li>
|
|||
|
<li><a href="#atx-headings">ATX headings</a></li>
|
|||
|
<li><a href="#setext-headings">Setext headings</a></li>
|
|||
|
<li><a href="#indented-code-blocks">Indented code blocks</a></li>
|
|||
|
<li><a href="#fenced-code-blocks">Fenced code blocks</a></li>
|
|||
|
<li><a href="#html-blocks">HTML blocks</a></li>
|
|||
|
<li><a href="#link-reference-definitions">Link reference definitions</a></li>
|
|||
|
<li><a href="#paragraphs">Paragraphs</a></li>
|
|||
|
<li><a href="#blank-lines">Blank lines</a></li>
|
|||
|
<li><a href="#tables-extension">Tables (extension)</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<a href="#container-blocks">Container blocks</a><ul>
|
|||
|
<li><a href="#block-quotes">Block quotes</a></li>
|
|||
|
<li>
|
|||
|
<a href="#list-items">List items</a><ul><li><a href="#motivation">Motivation</a></li></ul>
|
|||
|
</li>
|
|||
|
<li><a href="#task-list-items-extension">Task list items (extension)</a></li>
|
|||
|
<li><a href="#lists">Lists</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<a href="#inlines">Inlines</a><ul>
|
|||
|
<li><a href="#backslash-escapes">Backslash escapes</a></li>
|
|||
|
<li><a href="#entity-and-numeric-character-references">Entity and numeric character references</a></li>
|
|||
|
<li><a href="#code-spans">Code spans</a></li>
|
|||
|
<li><a href="#emphasis-and-strong-emphasis">Emphasis and strong emphasis</a></li>
|
|||
|
<li><a href="#strikethrough-extension">Strikethrough (extension)</a></li>
|
|||
|
<li><a href="#links">Links</a></li>
|
|||
|
<li><a href="#images">Images</a></li>
|
|||
|
<li><a href="#autolinks">Autolinks</a></li>
|
|||
|
<li><a href="#autolinks-extension">Autolinks (extension)</a></li>
|
|||
|
<li><a href="#raw-html">Raw HTML</a></li>
|
|||
|
<li><a href="#disallowed-raw-html-extension">Disallowed Raw HTML (extension)</a></li>
|
|||
|
<li><a href="#hard-line-breaks">Hard line breaks</a></li>
|
|||
|
<li><a href="#soft-line-breaks">Soft line breaks</a></li>
|
|||
|
<li><a href="#textual-content">Textual content</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<a href="#gitlab-official-specification-markdown">GitLab Official Specification Markdown</a><ul>
|
|||
|
<li><a href="#footnotes">Footnotes</a></li>
|
|||
|
<li><a href="#task-list-items">Task list items</a></li>
|
|||
|
<li><a href="#front-matter">Front matter</a></li>
|
|||
|
<li><a href="#table-of-contents">Table of contents</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<a href="#gitlab-internal-extension-markdown">GitLab Internal Extension Markdown</a><ul>
|
|||
|
<li><a href="#audio">Audio</a></li>
|
|||
|
<li><a href="#video">Video</a></li>
|
|||
|
<li><a href="#markdown-preview-api-request-overrides">Markdown Preview API Request Overrides</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul> tag on its own line.
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11175:1-11181:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[TOC]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"># Heading 1</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">## Heading 2</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11183:1-11194:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> <ul></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> <ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> </ul></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> </ul></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></nav></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><h1>Heading 1</h1></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11196:1-11202:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"># Heading 1</span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">## Heading 2</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11204:1-11215:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> <ul></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> <ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"> </ul></span>
|
|||
|
<span id="LC7" class="line" lang="plaintext"> </ul></span>
|
|||
|
<span id="LC8" class="line" lang="plaintext"></nav></span>
|
|||
|
<span id="LC9" class="line" lang="plaintext"><h1>Heading 1</h1></span>
|
|||
|
<span id="LC10" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11217:1-11218:5" dir="auto">A table of contents is a block element. It should preceded and followed by a blank
|
|||
|
line.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11220:1-11226:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext">text</span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext">text</span>
|
|||
|
<span id="LC5" class="line" lang="plaintext">[TOC]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11228:1-11231:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[[<em>TOC</em>]]text</p></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"><p>text[TOC]</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11233:1-11233:60" dir="auto">A table of contents can be indented with up to three spaces.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11235:1-11239:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [[_TOC_]]</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"># Heading 1</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11241:1-11248:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"> <ul></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span>
|
|||
|
<span id="LC4" class="line" lang="plaintext"> </ul></span>
|
|||
|
<span id="LC5" class="line" lang="plaintext"></nav></span>
|
|||
|
<span id="LC6" class="line" lang="plaintext"><h1>Heading 1</h1></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h1 data-sourcepos="11250:1-11250:36" dir="auto">
|
|||
|
<a id="user-content-gitlab-internal-extension-markdown" class="anchor" href="#gitlab-internal-extension-markdown" aria-hidden="true"></a>GitLab Internal Extension Markdown</h1>
|
|||
|
<h2 data-sourcepos="11252:1-11252:8" dir="auto">
|
|||
|
<a id="user-content-audio" class="anchor" href="#audio" aria-hidden="true"></a>Audio</h2>
|
|||
|
<p data-sourcepos="11254:1-11255:107" dir="auto">See
|
|||
|
<a href="https://docs.gitlab.com/ee/user/markdown.html#audio" rel="nofollow noreferrer noopener" target="_blank">audio</a> in the GitLab Flavored Markdown documentation.</p>
|
|||
|
<p data-sourcepos="11257:1-11259:63" dir="auto">GLFM renders image elements as an audio player as long as the resource’s file extension is
|
|||
|
one of the following supported audio extensions <code>.mp3</code>, <code>.oga</code>, <code>.ogg</code>, <code>.spx</code>, and <code>.wav</code>.
|
|||
|
Audio ignore the alternative text part of an image declaration.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11261:1-11263:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![audio](audio.oga "audio title")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11265:1-11267:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><audio src="audio.oga" title="audio title"></audio></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11269:1-11269:41" dir="auto">Reference definitions work audio as well:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11271:1-11275:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[audio]: audio.oga "audio title"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">![audio][audio]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11277:1-11279:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><audio src="audio.oga" title="audio title"></audio></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="11281:1-11281:8" dir="auto">
|
|||
|
<a id="user-content-video" class="anchor" href="#video" aria-hidden="true"></a>Video</h2>
|
|||
|
<p data-sourcepos="11283:1-11284:109" dir="auto">See
|
|||
|
<a href="https://docs.gitlab.com/ee/user/markdown.html#videos" rel="nofollow noreferrer noopener" target="_blank">videos</a> in the GitLab Flavored Markdown documentation.</p>
|
|||
|
<p data-sourcepos="11286:1-11288:64" dir="auto">GLFM renders image elements as a video player as long as the resource’s file extension is
|
|||
|
one of the following supported video extensions <code>.mp4</code>, <code>.m4v</code>, <code>.mov</code>, <code>.webm</code>, and <code>.ogv</code>.
|
|||
|
Videos ignore the alternative text part of an image declaration.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11291:1-11293:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![video](video.m4v "video title")</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11295:1-11297:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><video src="video.m4v" title="video title"></video></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11299:1-11299:41" dir="auto">Reference definitions work video as well:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11301:1-11305:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[video]: video.mov "video title"</span>
|
|||
|
<span id="LC2" class="line" lang="plaintext"></span>
|
|||
|
<span id="LC3" class="line" lang="plaintext">![video][video]</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11307:1-11309:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><video src="video.mov" title="video title"></video></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<h2 data-sourcepos="11311:1-11311:41" dir="auto">
|
|||
|
<a id="user-content-markdown-preview-api-request-overrides" class="anchor" href="#markdown-preview-api-request-overrides" aria-hidden="true"></a>Markdown Preview API Request Overrides</h2>
|
|||
|
<p data-sourcepos="11313:1-11315:42" dir="auto">This section contains examples of all controllers which use <code>PreviewMarkdown</code> module
|
|||
|
and use different <code>markdown_context_params</code>. They exercise the various <code>preview_markdown</code>
|
|||
|
endpoints via <code>glfm_example_metadata.yml</code>.</p>
|
|||
|
<p data-sourcepos="11318:1-11318:75" dir="auto"><code>preview_markdown</code> exercising <code>groups</code> API endpoint and <code>UploadLinkFilter</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11320:1-11322:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[groups-test-file](/uploads/groups-test-file)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11324:1-11326:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="groups-test-file">groups-test-file</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11328:1-11328:81" dir="auto"><code>preview_markdown</code> exercising <code>projects</code> API endpoint and <code>RepositoryLinkFilter</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11330:1-11332:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[projects-test-file](projects-test-file)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11334:1-11336:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="projects-test-file">projects-test-file</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11338:1-11338:83" dir="auto"><code>preview_markdown</code> exercising <code>projects</code> API endpoint and <code>SnippetReferenceFilter</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11340:1-11342:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This project snippet ID reference IS filtered: $88888</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11344:1-11346:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>This project snippet ID reference IS filtered: $88888</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11348:1-11351:50" dir="auto"><code>preview_markdown</code> exercising personal (non-project) <code>snippets</code> API endpoint. This is
|
|||
|
only used by the comment field on personal snippets. It has no unique custom markdown
|
|||
|
extension behavior, and specifically does not render snippet references via
|
|||
|
<code>SnippetReferenceFilter</code>, even if the ID is valid.</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11353:1-11355:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This personal snippet ID reference is not filtered: $99999</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11357:1-11359:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>This personal snippet ID reference is not filtered: $99999</p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11361:1-11361:80" dir="auto"><code>preview_markdown</code> exercising project <code>wikis</code> API endpoint and <code>WikiLinkFilter</code>:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11363:1-11365:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[project-wikis-test-file](project-wikis-test-file)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11367:1-11369:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="project-wikis-test-file">project-wikis-test-file</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<p data-sourcepos="11371:1-11372:63" dir="auto"><code>preview_markdown</code> exercising group <code>wikis</code> API endpoint and <code>WikiLinkFilter</code>. This example
|
|||
|
also requires an EE license enabling the <code>group_wikis</code> feature:</p>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11374:1-11376:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[group-wikis-test-file](group-wikis-test-file)</span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|
|||
|
<div class="gl-relative markdown-code-block js-markdown-code">
|
|||
|
<pre data-sourcepos="11378:1-11380:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="group-wikis-test-file">group-wikis-test-file</a></p></span></code></pre>
|
|||
|
<copy-code></copy-code>
|
|||
|
</div>
|