debian-mirror-gitlab/glfm_specification/output_example_snapshots/snapshot_spec.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13553 lines
914 KiB
HTML
Raw Normal View History

2023-03-04 22:38:38 +05:30
<!DOCTYPE html>
<!-- NOTE: Styling is based on the CommonMark specification template: -->
<!-- - https://github.com/commonmark/commonmark-spec/blob/master/tools/make_spec.lua -->
<!-- - https://github.com/commonmark/commonmark-spec/blob/master/tools/template.html -->
<!-- -->
<!-- NOTE: 'TODO:' comments will be followed up as task(s) on this issue: -->
<!-- - https://gitlab.com/gitlab-org/gitlab/-/issues/361241 -->
<html lang="en">
<head>
<meta charset="UTF-8">
<title>GitLab Flavored Markdown Internal Extensions</title>
<style type="text/css">
body {
font-family: Helvetica, arial, freesans, clean, sans-serif;
line-height: 1.4;
max-width: 48em;
margin: auto;
padding: 0 0.5em 4em;
color: #333333;
background-color: #ffffff;
font-size: 13pt;
}
div#TOC ul { list-style: none; }
h1 {
font-size: 140%;
font-weight: bold;
border-top: 1px solid gray;
padding-top: 0.5em;
}
h2 {
font-size: 120%;
font-weight: bold;
}
h3 {
font-size: 110%;
font-weight: bold;
}
h4 {
font-size: 100%;
font-weight: bold;
}
/* NOTE: "font-weight: bold" was applied to "a.definition" class in original CommonMark */
/* template, but in practice it was applied to all anchors */
a {
font-weight: bold;
}
/* TODO: Format whitespace in examples. This will require preprocessing to insert spans around them. */
/*span.space { position: relative; }*/
/*span.space:after {*/
/* content: "·";*/
/* position: absolute;*/
/* !* create a mark that indicates a space (trick from D. Greenspan) *!*/
/* top: 0; bottom: 7px; left: 1px; right: 1px;*/
/* color: #aaaaaa;*/
/*}*/
/*@media print {*/
/* a.dingus { display: none; }*/
/*}*/
div.example {
overflow: hidden;
}
p {
text-align: justify;
}
pre {
padding: 0.5em;
margin: 0.2em 0 0.5em;
font-size: 88%;
}
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
code {
font-family: monospace;
background-color: #d3e1e4;
}
pre > code {
background-color: transparent;
}
.example {
font-size: 0; /* hack to get width: 50% to work on inline-block */
padding-bottom: 6pt;
}
.column pre {
font-size: 11pt;
padding: 2pt 6pt;
}
div.examplenum {
font-size: 11pt;
text-align: left;
margin-bottom: 10px;
}
div.column {
display: inline-block;
width: 50%;
vertical-align: top;
}
div.example > div:nth-child(2) {
clear: left;
background-color: #d3e1e4;
}
div.example > div:nth-child(3) {
clear: right;
background-color: #c9cace;
}
@media print {
@page {
size: auto;
margin: 1.2in 1.2in 1.2in 1.2in;
}
body {
margin: 0;
line-height: 1.2;
font-size: 10pt;
}
.column pre {
font-size: 9pt;
}
div.examplenum {
font-size: 9pt;
}
}
</style>
<!-- TODO: Extract this javascript out to a separate file and unit test it -->
<script type="text/javascript">
/* NOTE: The following code performs many of the pre-processing steps originally handled */
/* in https://github.com/commonmark/commonmark-spec/blob/master/tools/make_spec.lua */
/* Adds a div.example wrapper around each pair of example code blocks. */
function addAttributesToExampleWrapperDivs() {
const exampleAnchorTags = document.querySelectorAll("a[href^=\"#example-\"]");
for (const exampleAnchorTag of exampleAnchorTags) {
const examplenumDiv = exampleAnchorTag.parentElement;
examplenumDiv.classList.add("examplenum");
const exampleDiv = examplenumDiv.parentElement;
exampleDiv.classList.add("example");
exampleDiv.id = exampleAnchorTag.getAttribute("href").substring(1);
}
}
function addColumnClassToMarkdownDivs() {
const markdownCodeBlockDivs = document.querySelectorAll("div.markdown-code-block");
for (const markdownCodeBlockDiv of markdownCodeBlockDivs) {
markdownCodeBlockDiv.classList.add("column");
}
}
function addNumbersToHeaders() {
const headers = document.querySelectorAll('h1,h2,h3');
let h1Index = -1; // NOTE: -1 because we don't assign a number to the title
let h2Index = 0;
let h3Index = 0;
const tocEntries = [];
for (const header of headers) {
if (h1Index === -1) {
h1Index++;
continue;
}
const originalHeaderTextContent = header.textContent.trim();
const headerAnchor = originalHeaderTextContent.toLowerCase().replaceAll(' ', '-');
header.id = headerAnchor;
let indent;
let headerTextContent;
if (header.tagName === 'H1') {
h1Index++;
h2Index = 0;
h3Index = 0;
header.textContent = headerTextContent = h1Index + ' ' + originalHeaderTextContent;
indent = 0;
} else if (header.tagName === 'H2') {
h2Index++;
h3Index = 0;
header.textContent =
headerTextContent = h1Index + '.' + h2Index + ' ' + originalHeaderTextContent;
indent = 1;
} else if (header.tagName === 'H3') {
h3Index++;
header.textContent = headerTextContent =
h1Index + '.' + h2Index + '.' + h3Index + ' ' + originalHeaderTextContent;
indent = 2;
}
tocEntries.push({headerAnchor, headerTextContent, indent});
}
}
document.addEventListener("DOMContentLoaded", function(_event) {
addAttributesToExampleWrapperDivs();
addColumnClassToMarkdownDivs();
const tocEntries = addNumbersToHeaders();
addToc(tocEntries);
});
/* NOTE: The following code is to support the "Try it" interactive "dingus", which */
/* we do not yet support. But it is being left here for comparison context with the */
/* original CommonMark template. */
// $$(document).ready(function() {
// $$("div.example").each(function(e) {
// var t = $$(this).find('code.language-markdown').text();
// $$(this).find('a.dingus').click(function(f) {
// window.open('/dingus/?text=' +
// encodeURIComponent(t.replace(/→/g,"\t")));
// });
// });
// $$("code.language-markdown").dblclick(function(e) { window.open('/dingus/?text=' +
// encodeURIComponent($$(this).text()));
// });
// });
</script>
</head>
<body>
<h1 class="title">GitLab Flavored Markdown Internal Extensions</h1>
<div class="version">Version alpha</div>
<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>
<li>
<a href="#migrated-golden-master-examples">Migrated golden master examples</a><ul>
<li><a href="#attachment_image_for_group">attachment_image_for_group</a></li>
<li><a href="#attachment_image_for_project">attachment_image_for_project</a></li>
<li><a href="#attachment_image_for_project_wiki">attachment_image_for_project_wiki</a></li>
<li><a href="#attachment_link_for_group">attachment_link_for_group</a></li>
<li><a href="#attachment_link_for_project">attachment_link_for_project</a></li>
<li><a href="#attachment_link_for_project_wiki">attachment_link_for_project_wiki</a></li>
<li><a href="#attachment_link_for_group_wiki">attachment_link_for_group_wiki</a></li>
<li><a href="#audio-1">audio</a></li>
<li><a href="#audio_and_video_in_lists">audio_and_video_in_lists</a></li>
<li><a href="#blockquote">blockquote</a></li>
<li><a href="#bold">bold</a></li>
<li><a href="#bullet_list_style_1">bullet_list_style_1</a></li>
<li><a href="#bullet_list_style_2">bullet_list_style_2</a></li>
<li><a href="#bullet_list_style_3">bullet_list_style_3</a></li>
<li><a href="#code_block_javascript">code_block_javascript</a></li>
<li><a href="#code_block_plaintext">code_block_plaintext</a></li>
<li><a href="#code_block_unknown">code_block_unknown</a></li>
<li><a href="#color_chips">color_chips</a></li>
<li><a href="#description_list">description_list</a></li>
<li><a href="#details">details</a></li>
<li><a href="#diagram_kroki_nomnoml">diagram_kroki_nomnoml</a></li>
<li><a href="#diagram_plantuml">diagram_plantuml</a></li>
<li><a href="#diagram_plantuml_unicode">diagram_plantuml_unicode</a></li>
<li><a href="#div">div</a></li>
<li><a href="#emoji">emoji</a></li>
<li><a href="#emphasis">emphasis</a></li>
<li><a href="#figure">figure</a></li>
<li><a href="#footnotes-1">footnotes</a></li>
<li><a href="#frontmatter_json">frontmatter_json</a></li>
<li><a href="#frontmatter_toml">frontmatter_toml</a></li>
<li><a href="#frontmatter_yaml">frontmatter_yaml</a></li>
<li><a href="#hard_break">hard_break</a></li>
<li><a href="#headings">headings</a></li>
<li><a href="#horizontal_rule">horizontal_rule</a></li>
<li><a href="#html_marks">html_marks</a></li>
<li><a href="#image">image</a></li>
<li><a href="#inline_code">inline_code</a></li>
<li><a href="#inline_diff">inline_diff</a></li>
<li><a href="#label">label</a></li>
<li><a href="#link">link</a></li>
<li><a href="#math">math</a></li>
<li><a href="#ordered_list">ordered_list</a></li>
<li><a href="#ordered_list_with_start_order">ordered_list_with_start_order</a></li>
<li><a href="#ordered_task_list">ordered_task_list</a></li>
<li><a href="#ordered_task_list_with_order">ordered_task_list_with_order</a></li>
<li><a href="#reference_for_project_wiki">reference_for_project_wiki</a></li>
<li><a href="#strike">strike</a></li>
<li><a href="#table">table</a></li>
<li><a href="#table_of_contents">table_of_contents</a></li>
<li><a href="#task_list">task_list</a></li>
<li><a href="#video-1">video</a></li>
<li><a href="#word_break">word_break</a></li>
</ul>
</li>
<li><a href="#image-attributes">Image Attributes</a></li>
</ul>
</li>
</ul>
<h1 data-sourcepos="3:1-3:15" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-preliminaries" class="anchor" href="#preliminaries" aria-hidden="true"></a>Preliminaries</h1>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="5:1-5:23" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-characters-and-lines" class="anchor" href="#characters-and-lines" aria-hidden="true"></a>Characters and lines</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7:1-8:9" dir="auto">Any sequence of [characters] is a valid CommonMark
2023-01-13 00:05:48 +05:30
document.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10:1-13:26" dir="auto">A <a href="@">character</a> is a Unicode code point. Although some
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="15:1-17:22" dir="auto">This spec does not specify an encoding; it thinks of lines as composed
2023-01-13 00:05:48 +05:30
of [characters] rather than bytes. A conforming parser may be limited
to a certain encoding.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="19:1-21:50" dir="auto">A <a href="@">line</a> is a sequence of zero or more [characters]
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="23:1-25:18" dir="auto">A <a href="@">line ending</a> is a newline (<code>U+000A</code>), a carriage return
2023-01-13 00:05:48 +05:30
(<code>U+000D</code>) not followed by a newline, or a carriage return and a
following newline.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="27:1-28:59" dir="auto">A line containing no characters, or a line containing only spaces
2023-01-13 00:05:48 +05:30
(<code>U+0020</code>) or tabs (<code>U+0009</code>), is called a <a href="@">blank line</a>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="30:1-30:73" dir="auto">The following definitions of character classes will be used in this spec:</p>
<p data-sourcepos="32:1-34:52" dir="auto">A <a href="@">whitespace character</a> is a space
2023-01-13 00:05:48 +05:30
(<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="36:1-37:12" dir="auto"><a href="@">Whitespace</a> is a sequence of one or more [whitespace
2023-01-13 00:05:48 +05:30
characters].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="39:1-42:11" dir="auto">A <a href="@">Unicode whitespace character</a> is
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="44:1-45:40" dir="auto"><a href="@">Unicode whitespace</a> is a sequence of one
2023-01-13 00:05:48 +05:30
or more [Unicode whitespace characters].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="47:1-47:25" dir="auto">A <a href="@">space</a> is <code>U+0020</code>.</p>
<p data-sourcepos="49:1-50:37" dir="auto">A <a href="@">non-whitespace character</a> is any character
2023-01-13 00:05:48 +05:30
that is not a [whitespace character].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="52:1-57:38" dir="auto">An <a href="@">ASCII punctuation character</a>
2023-01-13 00:05:48 +05:30
is <code>!</code>, <code>"</code>, <code>#</code>, <code>$</code>, <code>%</code>, <code>&amp;</code>, <code>'</code>, <code>(</code>, <code>)</code>,
<code>*</code>, <code>+</code>, <code>,</code>, <code>-</code>, <code>.</code>, <code>/</code> (U+00212F),
<code>:</code>, <code>;</code>, <code>&lt;</code>, <code>=</code>, <code>&gt;</code>, <code>?</code>, <code>@</code> (U+003A0040),
<code>[</code>, <code>\</code>, <code>]</code>, <code>^</code>, <code>_</code>, <code>`</code> (U+005B0060),
<code>{</code>, <code>|</code>, <code>}</code>, or <code>~</code> (U+007B007E).</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="59:1-61:76" dir="auto">A <a href="@">punctuation character</a> is an [ASCII
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="63:1-63:7" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-tabs" class="anchor" href="#tabs" aria-hidden="true"></a>Tabs</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="65:1-68:16" dir="auto">Tabs in lines are not expanded to [spaces]. However,
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="70:1-73:8" dir="auto">Thus, for example, a tab can be used instead of four spaces
2023-01-13 00:05:48 +05:30
in an indented code block. (Note, however, that internal
tabs are passed through as literal tabs, not expanded to
spaces.)</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-1">Example 1</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="78:1-80:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="82:1-85:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo→baz→→bim</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-2">Example 2</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="91:1-93:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="95:1-98:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo→baz→→bim</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-3">Example 3</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="104:1-107:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="109:1-113:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;a→a</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">ὐ→a</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="116:1-118:38" dir="auto">In the following example, a continuation paragraph of a list
2023-01-13 00:05:48 +05:30
item is indented with a tab; this has exactly the same effect
as indentation with four spaces would:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-4">Example 4</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="123:1-127:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="129:1-136:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-5">Example 5</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="142:1-146:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="148:1-156:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt; bar</span>
<span id="LC5" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="159:1-166:36" dir="auto">Normally the <code>&gt;</code> that begins a block quote may be followed
2023-01-13 00:05:48 +05:30
optionally by a space, which is not considered part of the
content. In the following case <code>&gt;</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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-6">Example 6</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="171:1-173:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt;→→foo</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="175:1-180:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt; foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-7">Example 7</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="186:1-188:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="190:1-197:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt; foo</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-8">Example 8</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="204:1-207:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="209:1-213:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-9">Example 9</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="219:1-223:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="225:1-237:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;bar</span>
<span id="LC5" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;baz&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-10">Example 10</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="243:1-245:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="247:1-249:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;Foo&lt;/h1&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-11">Example 11</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="255:1-257:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="259:1-261:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="265:1-265:22" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-insecure-characters" class="anchor" href="#insecure-characters" aria-hidden="true"></a>Insecure characters</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="267:1-268:42" dir="auto">For security reasons, the Unicode character <code>U+0000</code> must be replaced
2023-01-13 00:05:48 +05:30
with the REPLACEMENT CHARACTER (<code>U+FFFD</code>).</p>
2023-03-04 22:38:38 +05:30
<h1 data-sourcepos="270:1-270:20" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-blocks-and-inlines" class="anchor" href="#blocks-and-inlines" aria-hidden="true"></a>Blocks and inlines</h1>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="272:1-277:54" dir="auto">We can think of a document as a sequence of
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="279:1-279:13" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-precedence" class="anchor" href="#precedence" aria-hidden="true"></a>Precedence</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="281:1-283:59" dir="auto">Indicators of block structure always take precedence over indicators
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-12">Example 12</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="288:1-291:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="293:1-298:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;`one&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;two`&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="302:1-309:66" dir="auto">This means that parsing can proceed in two steps: first, the block
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="311:1-311:35" dir="auto">
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="313:1-316:13" dir="auto">We can divide blocks into two types:
2023-01-13 00:05:48 +05:30
<a href="@">container blocks</a>,
which can contain other blocks, and <a href="@">leaf blocks</a>,
which cannot.</p>
2023-03-04 22:38:38 +05:30
<h1 data-sourcepos="318:1-318:13" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-leaf-blocks" class="anchor" href="#leaf-blocks" aria-hidden="true"></a>Leaf blocks</h1>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="320:1-321:18" dir="auto">This section describes the different kinds of leaf block that make up a
2023-01-13 00:05:48 +05:30
Markdown document.</p>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="323:1-323:18" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-thematic-breaks" class="anchor" href="#thematic-breaks" aria-hidden="true"></a>Thematic breaks</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="325:1-328:20" dir="auto">A line consisting of 0-3 spaces of indentation, followed by a sequence
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-13">Example 13</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="333:1-337:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="339:1-343:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="347:1-347:17" dir="auto">Wrong characters:</p>
<div>
<div><a href="#example-14">Example 14</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="352:1-354:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="356:1-358:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;+++&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-15">Example 15</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="365:1-367:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="369:1-371:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;===&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="375:1-375:22" dir="auto">Not enough characters:</p>
<div>
<div><a href="#example-16">Example 16</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="380:1-384:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="386:1-390:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;--</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">**</span>
<span id="LC3" class="line" lang="plaintext">__&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="394:1-394:39" dir="auto">One to three spaces indent are allowed:</p>
<div>
<div><a href="#example-17">Example 17</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="399: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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="405:1-409:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="413:1-413:24" dir="auto">Four spaces is too many:</p>
<div>
<div><a href="#example-18">Example 18</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="418:1-420:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="422:1-425:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;***</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-19">Example 19</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="432:1-435:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="437:1-440:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">***&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="444:1-444:39" dir="auto">More than three characters may be used:</p>
<div>
<div><a href="#example-20">Example 20</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="449:1-451:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="453:1-455:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="459:1-459:42" dir="auto">Spaces are allowed between the characters:</p>
<div>
<div><a href="#example-21">Example 21</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="464:1-466:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="468:1-470:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-22">Example 22</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="477:1-479:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="481:1-483:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-23">Example 23</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="490:1-492:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="494:1-496:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="500:1-500:30" dir="auto">Spaces are allowed at the end:</p>
<div>
<div><a href="#example-24">Example 24</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="505:1-507:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="509:1-511:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="515:1-515:51" dir="auto">However, no other characters may occur in the line:</p>
<div>
<div><a href="#example-25">Example 25</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="520:1-526:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="528:1-532:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_ _ _ _ a&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;a------&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;---a---&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="536:1-537:33" dir="auto">It is required that all of the [non-whitespace characters] be the same.
2023-01-13 00:05:48 +05:30
So, this is not a thematic break:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-26">Example 26</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="542:1-544:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="546:1-548:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;-&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="552:1-552:56" dir="auto">Thematic breaks do not need blank lines before or after:</p>
<div>
<div><a href="#example-27">Example 27</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="557:1-561:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="563: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">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="575:1-575:42" dir="auto">Thematic breaks can interrupt a paragraph:</p>
<div>
<div><a href="#example-28">Example 28</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="580:1-584:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="586:1-590:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="594:1-598:71" dir="auto">If a line of dashes that meets the above conditions for being a
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-29">Example 29</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="603:1-607:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="609:1-612:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;Foo&lt;/h2&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="616:1-617:63" dir="auto">When both a thematic break and a list item are possible
2023-01-13 00:05:48 +05:30
interpretations of a line, the thematic break takes precedence:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-30">Example 30</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="622:1-626:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="628:1-636:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;Foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;Bar&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="640:1-640:68" dir="auto">If you want a thematic break in a list item, use a different bullet:</p>
<div>
<div><a href="#example-31">Example 31</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="645:1-648:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="650:1-657:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;Foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="661:1-661:15" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-atx-headings" class="anchor" href="#atx-headings" aria-hidden="true"></a>ATX headings</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="663:1-673:35" dir="auto">An <a href="@">ATX heading</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="675:1-675:16" dir="auto">Simple headings:</p>
<div>
<div><a href="#example-32">Example 32</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="680:1-687:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="689:1-696:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;foo&lt;/h1&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;foo&lt;/h2&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h3&gt;foo&lt;/h3&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;h4&gt;foo&lt;/h4&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;h5&gt;foo&lt;/h5&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;h6&gt;foo&lt;/h6&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="700:1-700:46" dir="auto">More than six <code>#</code> characters is not a heading:</p>
<div>
<div><a href="#example-33">Example 33</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="705:1-707:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="709:1-711:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;####### foo&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="715:1-721:9" dir="auto">At least one space is required between the <code>#</code> characters and the
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-34">Example 34</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="726: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">#5 bolt</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="732:1-735:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;#5 bolt&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;#hashtag&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="739:1-739:56" dir="auto">This is not a heading, because the first <code>#</code> is escaped:</p>
<div>
<div><a href="#example-35">Example 35</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="744:1-746:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="748: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">&lt;p&gt;## foo&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="754:1-754:31" dir="auto">Contents are parsed as inlines:</p>
<div>
<div><a href="#example-36">Example 36</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="759:1-761:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="763:1-765:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;foo &lt;em&gt;bar&lt;/em&gt; *baz*&lt;/h1&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="769:1-769:71" dir="auto">Leading and trailing [whitespace] is ignored in parsing inline content:</p>
<div>
<div><a href="#example-37">Example 37</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="774:1-776:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="778:1-780:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;foo&lt;/h1&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="784:1-784:44" dir="auto">One to three spaces indentation are allowed:</p>
<div>
<div><a href="#example-38">Example 38</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="789:1-793:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="795:1-799:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h3&gt;foo&lt;/h3&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;foo&lt;/h2&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h1&gt;foo&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="803:1-803:25" dir="auto">Four spaces are too much:</p>
<div>
<div><a href="#example-39">Example 39</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="808:1-810:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="812:1-815:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;# foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-40">Example 40</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="822:1-825:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="827:1-830:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"># bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="834:1-834:49" dir="auto">A closing sequence of <code>#</code> characters is optional:</p>
<div>
<div><a href="#example-41">Example 41</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="839:1-842:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="844:1-847:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;foo&lt;/h2&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h3&gt;bar&lt;/h3&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="851:1-851:55" dir="auto">It need not be the same length as the opening sequence:</p>
<div>
<div><a href="#example-42">Example 42</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="856:1-859:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="861:1-864:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;foo&lt;/h1&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h5&gt;foo&lt;/h5&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="868:1-868:46" dir="auto">Spaces are allowed after the closing sequence:</p>
<div>
<div><a href="#example-43">Example 43</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="873:1-875:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="877:1-879:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h3&gt;foo&lt;/h3&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="883:1-885:8" dir="auto">A sequence of <code>#</code> characters with anything but [spaces] following it
2023-01-13 00:05:48 +05:30
is not a closing sequence, but counts as part of the contents of the
heading:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-44">Example 44</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="890:1-892:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="894:1-896:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h3&gt;foo ### b&lt;/h3&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="900:1-900:49" dir="auto">The closing sequence must be preceded by a space:</p>
<div>
<div><a href="#example-45">Example 45</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="905:1-907:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="909:1-911:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;foo#&lt;/h1&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="915:1-916:24" dir="auto">Backslash-escaped <code>#</code> characters do not count as part
2023-01-13 00:05:48 +05:30
of the closing sequence:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-46">Example 46</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="921:1-925:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="927:1-931:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h3&gt;foo ###&lt;/h3&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;foo ###&lt;/h2&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h1&gt;foo #&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="935:1-936:41" dir="auto">ATX headings need not be separated from surrounding content by blank
2023-01-13 00:05:48 +05:30
lines, and they can interrupt paragraphs:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-47">Example 47</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="941:1-945:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="947:1-951:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;foo&lt;/h2&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-48">Example 48</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="958:1-962:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="964:1-968:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo bar&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h1&gt;baz&lt;/h1&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;Bar foo&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="972:1-972:26" dir="auto">ATX headings can be empty:</p>
<div>
<div><a href="#example-49">Example 49</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="977:1-981:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="983:1-987:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;&lt;/h2&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h1&gt;&lt;/h1&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h3&gt;&lt;/h3&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="991:1-991:18" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-setext-headings" class="anchor" href="#setext-headings" aria-hidden="true"></a>Setext headings</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="993:1-1001:54" dir="auto">A <a href="@">setext heading</a> consists of one or more
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1003:1-1008:40" dir="auto">A <a href="@">setext heading underline</a> is a sequence of
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1010:1-1014:8" dir="auto">The heading is a level 1 heading if <code>=</code> characters are used in
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1016:1-1019:5" dir="auto">In general, a setext heading need not be preceded or followed by a
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1021:1-1021:16" dir="auto">Simple examples:</p>
<div>
<div><a href="#example-50">Example 50</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1026:1-1032:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1034:1-1037:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;Foo &lt;em&gt;bar&lt;/em&gt;&lt;/h1&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;Foo &lt;em&gt;bar&lt;/em&gt;&lt;/h2&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1041:1-1041:54" dir="auto">The content of the header may span more than one line:</p>
<div>
<div><a href="#example-51">Example 51</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1046:1-1050:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1052:1-1055:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;Foo &lt;em&gt;bar</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">baz&lt;/em&gt;&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1058:1-1061:13" dir="auto">The contents are the result of parsing the headings's raw
2023-01-13 00:05:48 +05:30
content as inlines. The heading's raw content is formed by
concatenating the lines and removing initial and final
[whitespace].</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-52">Example 52</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1066:1-1070:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1072:1-1075:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;Foo &lt;em&gt;bar</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">baz&lt;/em&gt;&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1079:1-1079:34" dir="auto">The underlining can be any length:</p>
<div>
<div><a href="#example-53">Example 53</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1084:1-1090:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1092:1-1095:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;Foo&lt;/h2&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h1&gt;Foo&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1099:1-1100:33" dir="auto">The heading content can be indented up to three spaces, and need
2023-01-13 00:05:48 +05:30
not line up with the underlining:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-54">Example 54</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1105:1-1114:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1116:1-1120:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;Foo&lt;/h2&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;Foo&lt;/h2&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h1&gt;Foo&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1124:1-1124:31" dir="auto">Four spaces indent is too much:</p>
<div>
<div><a href="#example-55">Example 55</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1129:1-1135:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1137:1-1144:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1148:1-1149:25" dir="auto">The setext heading underline can be indented up to three spaces, and
2023-01-13 00:05:48 +05:30
may have trailing spaces:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-56">Example 56</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1154:1-1157:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1159: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">&lt;h2&gt;Foo&lt;/h2&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1165:1-1165:24" dir="auto">Four spaces is too much:</p>
<div>
<div><a href="#example-57">Example 57</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1170:1-1173:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1175:1-1178:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">---&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1182:1-1182:60" dir="auto">The setext heading underline cannot contain internal spaces:</p>
<div>
<div><a href="#example-58">Example 58</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1187:1-1193:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1195:1-1200:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">= =&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;Foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1204:1-1204:62" dir="auto">Trailing spaces in the content line do not cause a line break:</p>
<div>
<div><a href="#example-59">Example 59</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1209:1-1212:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1214:1-1216:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;Foo&lt;/h2&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1220:1-1220:32" dir="auto">Nor does a backslash at the end:</p>
<div>
<div><a href="#example-60">Example 60</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1225:1-1228:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1230: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">&lt;h2&gt;Foo\&lt;/h2&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1236:1-1237:66" dir="auto">Since indicators of block structure take precedence over
2023-01-13 00:05:48 +05:30
indicators of inline structure, the following are setext headings:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-61">Example 61</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1242:1-1250:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">&lt;a title="a lot</span>
<span id="LC6" class="line" lang="plaintext">---</span>
<span id="LC7" class="line" lang="plaintext">of dashes"/&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1252:1-1257:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;`Foo&lt;/h2&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;`&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h2&gt;&amp;lt;a title=&amp;quot;a lot&lt;/h2&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;of dashes&amp;quot;/&amp;gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1261:1-1262:36" dir="auto">The setext heading underline cannot be a [lazy continuation
2023-01-13 00:05:48 +05:30
line] in a list item or block quote:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-62">Example 62</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1267:1-1270:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; Foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1272:1-1277:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;Foo&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-63">Example 63</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1284: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">&gt; foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1290:1-1296:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">bar</span>
<span id="LC4" class="line" lang="plaintext">===&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-64">Example 64</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1303:1-1306:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1308:1-1313:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;Foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1317:1-1319:25" dir="auto">A blank line is needed between a paragraph and a following
2023-01-13 00:05:48 +05:30
setext heading, since otherwise the paragraph becomes part
of the heading's content:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-65">Example 65</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1324:1-1328:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1330:1-1333:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">Bar&lt;/h2&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1337:1-1338:16" dir="auto">But in general a blank line is not required before or after
2023-01-13 00:05:48 +05:30
setext headings:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-66">Example 66</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1343:1-1350:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1352:1-1357:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;Foo&lt;/h2&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h2&gt;Bar&lt;/h2&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;Baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1361:1-1361:32" dir="auto">Setext headings cannot be empty:</p>
<div>
<div><a href="#example-67">Example 67</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1366:1-1369:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1371:1-1373:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;====&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1377:1-1379:55" dir="auto">Setext heading text lines must not be interpretable as block
2023-01-13 00:05:48 +05:30
constructs other than paragraphs. So, the line of dashes
in these examples gets interpreted as a thematic break:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-68">Example 68</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1384:1-1387:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1389:1-1392:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-69">Example 69</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1399:1-1402:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1404:1-1409:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-70">Example 70</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1416:1-1419:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1421:1-1425:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-71">Example 71</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1432:1-1435:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1437:1-1442:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1446:1-1447:22" dir="auto">If you want a heading with <code>&gt; foo</code> as its literal text, you can
2023-01-13 00:05:48 +05:30
use backslash escapes:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-72">Example 72</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">\&gt; foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1457:1-1459:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;&amp;gt; foo&lt;/h2&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1463:1-1465:48" dir="auto"><strong>Compatibility note:</strong> Most existing Markdown implementations
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1467:1-1472:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">Foo</span>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1474:1-1474:44" dir="auto">One can find four different interpretations:</p>
<ol data-sourcepos="1476:1-1480:0" dir="auto">
<li data-sourcepos="1476:1-1476:50">paragraph "Foo", heading "bar", paragraph "baz"</li>
<li data-sourcepos="1477:1-1477:55">paragraph "Foo bar", thematic break, paragraph "baz"</li>
<li data-sourcepos="1478:1-1478:30">paragraph "Foo bar --- baz"</li>
<li data-sourcepos="1479:1-1480:0">heading "Foo bar", paragraph "baz"</li>
2023-01-13 00:05:48 +05:30
</ol>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1481:1-1484:43" dir="auto">We find interpretation 4 most natural, and interpretation 4
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-73">Example 73</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1489:1-1495:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1497:1-1501:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;bar&lt;/h2&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1505:1-1506:19" dir="auto">Authors who want interpretation 2 can put blank lines around
2023-01-13 00:05:48 +05:30
the thematic break,</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-74">Example 74</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1511:1-1518:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1520:1-1525:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1529:1-1530:19" dir="auto">or use a thematic break that cannot count as a [setext heading
2023-01-13 00:05:48 +05:30
underline], such as</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-75">Example 75</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1535:1-1540:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1542:1-1547:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1551:1-1551:60" dir="auto">Authors who want interpretation 3 can use backslash escapes:</p>
<div>
<div><a href="#example-76">Example 76</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">Foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1563:1-1568:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<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&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="1572:1-1572:23" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-indented-code-blocks" class="anchor" href="#indented-code-blocks" aria-hidden="true"></a>Indented code blocks</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1574:1-1580:44" dir="auto">An <a href="@">indented code block</a> is composed of one or more
2023-01-13 00:05:48 +05:30
[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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1582:1-1585:11" dir="auto">An indented code block cannot interrupt a paragraph, so there must be
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-77">Example 77</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1590:1-1593:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1595:1-1599:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;a simple</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> indented code block</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1603:1-1605:65" dir="auto">If there is any ambiguity between an interpretation of indentation
2023-01-13 00:05:48 +05:30
as a code block and as indicating that material belongs to a [list
item][list items], the list item interpretation takes precedence:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-78">Example 78</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1610:1-1614:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1616:1-1623:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-79">Example 79</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1630:1-1634:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1636:1-1645:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1650:1-1651:12" dir="auto">The contents of a code block are literal text, and do not get parsed
2023-01-13 00:05:48 +05:30
as Markdown:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-80">Example 80</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1656:1-1661:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &lt;a/&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1663:1-1669:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&amp;lt;a/&amp;gt;</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1673:1-1673:51" dir="auto">Here we have three chunks separated by blank lines:</p>
<div>
<div><a href="#example-81">Example 81</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1678:1-1686:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1688:1-1697:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;chunk1</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1701:1-1702:24" dir="auto">Any initial spaces beyond four will be included in the content, even
2023-01-13 00:05:48 +05:30
in interior blank lines:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-82">Example 82</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1707:1-1711:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1713:1-1718:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;chunk1</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> </span>
<span id="LC3" class="line" lang="plaintext"> chunk2</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1722:1-1723:37" dir="auto">An indented code block cannot interrupt a paragraph. (This
2023-01-13 00:05:48 +05:30
allows hanging indents and the like.)</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-83">Example 83</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1728:1-1732:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1734:1-1737:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1741:1-1743:20" dir="auto">However, any non-blank line with fewer than four leading spaces ends
2023-01-13 00:05:48 +05:30
the code block immediately. So a paragraph may occur immediately
after indented code:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-84">Example 84</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1748:1-1751:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1753:1-1757:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1761:1-1762:7" dir="auto">And indented code can occur immediately before and after other kinds of
2023-01-13 00:05:48 +05:30
blocks:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-85">Example 85</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1767:1-1774:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1776:1-1784:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;Heading&lt;/h1&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;h2&gt;Heading&lt;/h2&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo</span>
<span id="LC6" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1788:1-1788:53" dir="auto">The first line can be indented more than four spaces:</p>
<div>
<div><a href="#example-86">Example 86</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1793:1-1796:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1798:1-1802:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt; foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1806:1-1807:23" dir="auto">Blank lines preceding or following an indented code block
2023-01-13 00:05:48 +05:30
are not included in it:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-87">Example 87</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1812:1-1818:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1820:1-1823:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1827:1-1827:57" dir="auto">Trailing spaces are included in the code block's content:</p>
<div>
<div><a href="#example-88">Example 88</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1832:1-1834:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1836:1-1839:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo </span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="1844:1-1844:21" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-fenced-code-blocks" class="anchor" href="#fenced-code-blocks" aria-hidden="true"></a>Fenced code blocks</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1846:1-1850:61" dir="auto">A <a href="@">code fence</a> is a sequence
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1852:1-1858:34" dir="auto">The line with the opening code fence may optionally contain some text
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1860:1-1867:43" dir="auto">The content of the code block consists of all subsequent lines, until
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1869:1-1877:25" dir="auto">The closing code fence may be indented up to three spaces, and may be
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1879:1-1880:36" dir="auto">A fenced code block may interrupt a paragraph, and does not require
2023-01-13 00:05:48 +05:30
a blank line either before or after.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1882:1-1886:42" dir="auto">The content of a code fence is treated as literal text, not parsed
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="1888:1-1888:40" dir="auto">Here is a simple example with backticks:</p>
<div>
<div><a href="#example-89">Example 89</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1893:1-1898:32" lang="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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;</span>
<span id="LC3" class="line" lang="plaintext"> &gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1900:1-1904:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&amp;lt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &amp;gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1908:1-1908:12" dir="auto">With tildes:</p>
<div>
<div><a href="#example-90">Example 90</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1913:1-1918:32" lang="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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;</span>
<span id="LC3" class="line" lang="plaintext"> &gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1920:1-1924:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&amp;lt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &amp;gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1927:1-1927:41" dir="auto">Fewer than three backticks is not enough:</p>
<div>
<div><a href="#example-91">Example 91</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1932:1-1936:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1938:1-1940:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;foo&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1943:1-1944:6" dir="auto">The closing code fence must use the same character as the opening
2023-01-13 00:05:48 +05:30
fence:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-92">Example 92</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1949:1-1954:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1956: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">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">~~~</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-93">Example 93</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1967:1-1972:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1974:1-1978:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">```</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="1982:1-1982:69" dir="auto">The closing code fence must be at least as long as the opening fence:</p>
<div>
<div><a href="#example-94">Example 94</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1987:1-1992:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="1994:1-1998:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">```</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-95">Example 95</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2005:1-2010:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2012:1-2016:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">~~~</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2020:1-2021:74" dir="auto">Unclosed code blocks are closed by the end of the document
2023-01-13 00:05:48 +05:30
(or the enclosing [block quote][block quotes] or [list item][list items]):</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-96">Example 96</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2026:1-2028:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2030:1-2032:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-97">Example 97</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2039:1-2044:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2046:1-2051:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">```</span>
<span id="LC3" class="line" lang="plaintext">aaa</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-98">Example 98</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2058:1-2063:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; ```</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; 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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2065:1-2071:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;bbb&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2075:1-2075:53" dir="auto">A code block can have all empty lines as its content:</p>
<div>
<div><a href="#example-99">Example 99</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2080:1-2085:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2087:1-2091:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> </span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2095:1-2095:26" dir="auto">A code block can be empty:</p>
<div>
<div><a href="#example-100">Example 100</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2100:1-2103:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2105:1-2107:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2111:1-2113:11" dir="auto">Fences can be indented. If the opening fence is indented,
2023-01-13 00:05:48 +05:30
content lines will have equivalent opening indentation removed,
if present:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-101">Example 101</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2118:1-2123:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2125:1-2129:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">aaa</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-102">Example 102</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2136:1-2142:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2144:1-2149:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-103">Example 103</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2156:1-2162:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2164:1-2169:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2173:1-2173:56" dir="auto">Four spaces indentation produces an indented code block:</p>
<div>
<div><a href="#example-104">Example 104</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2178:1-2182:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2184:1-2189:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;```</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">aaa</span>
<span id="LC3" class="line" lang="plaintext">```</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2193:1-2194:41" dir="auto">Closing fences may be indented by 0-3 spaces, and their indentation
2023-01-13 00:05:48 +05:30
need not match that of the opening fence:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-105">Example 105</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2199:1-2203:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2205:1-2208:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-106">Example 106</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2215:1-2219:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2221:1-2224:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2228:1-2228:61" dir="auto">This is not a closing fence, because it is indented 4 spaces:</p>
<div>
<div><a href="#example-107">Example 107</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2233:1-2237:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2239:1-2243:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> ```</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2248:1-2248:65" dir="auto">Code fences (opening and closing) cannot contain internal spaces:</p>
<div>
<div><a href="#example-108">Example 108</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2253:1-2256:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2258:1-2261:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt; &lt;/code&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">aaa&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-109">Example 109</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2268:1-2272:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2274:1-2278:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">~~~ ~~</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2282:1-2283:53" dir="auto">Fenced code blocks can interrupt paragraphs, and can be followed
2023-01-13 00:05:48 +05:30
directly by paragraphs, without a blank line between:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-110">Example 110</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2288:1-2294:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2296:1-2301:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;bar</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2305:1-2306:34" dir="auto">Other blocks can also occur before and after fenced code blocks
2023-01-13 00:05:48 +05:30
without an intervening blank line:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-111">Example 111</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2311:1-2318:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2320:1-2325:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h2&gt;foo&lt;/h2&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;bar</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;h1&gt;baz&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2329:1-2334:45" dir="auto">An [info string] can be provided after the opening code fence.
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-112">Example 112</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2339:1-2345:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2347:1-2352:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code class="language-ruby"&gt;def foo(x)</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-113">Example 113</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2359:1-2365:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2367:1-2372:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code class="language-ruby"&gt;def foo(x)</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-114">Example 114</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2379:1-2382:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2384:1-2386:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code class="language-;"&gt;&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2390:1-2390:65" dir="auto">[Info strings] for backtick code blocks cannot contain backticks:</p>
<div>
<div><a href="#example-115">Example 115</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2395:1-2398:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2400:1-2403:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;aa&lt;/code&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">foo&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2407:1-2407:70" dir="auto">[Info strings] for tilde code blocks can contain backticks and tildes:</p>
<div>
<div><a href="#example-116">Example 116</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2412:1-2416:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2418:1-2421:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code class="language-aa"&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2425:1-2425:47" dir="auto">Closing code fences cannot have [info strings]:</p>
<div>
<div><a href="#example-117">Example 117</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2430:1-2434:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2436:1-2439:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;``` aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="2444:1-2444:14" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-html-blocks" class="anchor" href="#html-blocks" aria-hidden="true"></a>HTML blocks</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="2446:1-2447:53" dir="auto">An <a href="@">HTML block</a> is a group of lines that is treated
2023-01-13 00:05:48 +05:30
as raw HTML (and will not be escaped in HTML output).</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="2449:1-2457:50" dir="auto">There are seven kinds of [HTML block], which can be defined by their
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<ol data-sourcepos="2459:1-2500:0" dir="auto">
<li data-sourcepos="2459:1-2465:0">
<p data-sourcepos="2459:5-2464:30"><strong>Start condition:</strong> line begins with the string <code>&lt;script</code>,
2023-01-13 00:05:48 +05:30
<code>&lt;pre</code>, or <code>&lt;style</code> (case-insensitive), followed by whitespace,
the string <code>&gt;</code>, or the end of the line.<br>
<strong>End condition:</strong> line contains an end tag
<code>&lt;/script&gt;</code>, <code>&lt;/pre&gt;</code>, or <code>&lt;/style&gt;</code> (case-insensitive; it
need not match the start tag).</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="2466:1-2468:0">
<p data-sourcepos="2466:5-2467:51"><strong>Start condition:</strong> line begins with the string <code>&lt;!--</code>.<br>
2023-01-13 00:05:48 +05:30
<strong>End condition:</strong> line contains the string <code>--&gt;</code>.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="2469:1-2471:0">
<p data-sourcepos="2469:5-2470:49"><strong>Start condition:</strong> line begins with the string <code>&lt;?</code>.<br>
2023-01-13 00:05:48 +05:30
<strong>End condition:</strong> line contains the string <code>?&gt;</code>.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="2472:1-2475:0">
<p data-sourcepos="2472:5-2474:51"><strong>Start condition:</strong> line begins with the string <code>&lt;!</code>
2023-01-13 00:05:48 +05:30
followed by an uppercase ASCII letter.<br>
<strong>End condition:</strong> line contains the character <code>&gt;</code>.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="2476:1-2479:0">
<p data-sourcepos="2476:5-2478:50"><strong>Start condition:</strong> line begins with the string
2023-01-13 00:05:48 +05:30
<code>&lt;![CDATA[</code>.<br>
<strong>End condition:</strong> line contains the string <code>]]&gt;</code>.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="2480:1-2494:0">
<p data-sourcepos="2480:5-2493:54"><strong>Start condition:</strong> line begins the string <code>&lt;</code> or <code>&lt;/</code>
2023-01-13 00:05:48 +05:30
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>&gt;</code>, or
the string <code>/&gt;</code>.<br>
<strong>End condition:</strong> line is followed by a [blank line].</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="2495:1-2500:0">
<p data-sourcepos="2495:5-2499:54"><strong>Start condition:</strong> line begins with a complete [open tag]
2023-01-13 00:05:48 +05:30
(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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="2501:1-2506:19" dir="auto">HTML blocks continue until they are closed by their appropriate
2023-01-13 00:05:48 +05:30
[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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="2508:1-2510:51" dir="auto">For instance, <code>&lt;pre&gt;</code> within a HTML block started by <code>&lt;table&gt;</code> will not affect
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-118">Example 118</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2515:1-2523:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;&lt;tr&gt;&lt;td&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;</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">&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2525:1-2532:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;&lt;tr&gt;&lt;td&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;</span>
<span id="LC3" class="line" lang="plaintext">**Hello**,</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;world&lt;/em&gt;.</span>
<span id="LC5" class="line" lang="plaintext">&lt;/pre&gt;&lt;/p&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2535:1-2537:55" dir="auto">In this case, the HTML block is terminated by the newline — the <code>**Hello**</code>
2023-01-13 00:05:48 +05:30
text remains verbatim — and regular parsing resumes, with a paragraph,
emphasised <code>world</code> and inline and block HTML following.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="2539:1-2542:65" dir="auto">All types of [HTML blocks] except type 7 may interrupt
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="2544:1-2545:10" dir="auto">Some simple examples follow. Here are some basic HTML blocks
2023-01-13 00:05:48 +05:30
of type 6:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-119">Example 119</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2550:1-2560:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &lt;tr&gt;</span>
<span id="LC3" class="line" lang="plaintext"> &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"> &lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/table&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2562:1-2571:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &lt;tr&gt;</span>
<span id="LC3" class="line" lang="plaintext"> &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"> &lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/table&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;p&gt;okay.&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-120">Example 120</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2578:1-2582:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> *hello*</span>
<span id="LC3" class="line" lang="plaintext"> &lt;foo&gt;&lt;a&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2584:1-2588:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> *hello*</span>
<span id="LC3" class="line" lang="plaintext"> &lt;foo&gt;&lt;a&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2592:1-2592:42" dir="auto">A block can also start with a closing tag:</p>
<div>
<div><a href="#example-121">Example 121</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2597:1-2600:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;/div&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2602:1-2605:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;/div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2609:1-2609:68" dir="auto">Here we have two HTML blocks with a Markdown paragraph between them:</p>
<div>
<div><a href="#example-122">Example 122</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2614:1-2620:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;DIV CLASS="foo"&gt;</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/DIV&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2622:1-2626:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;DIV CLASS="foo"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;Markdown&lt;/em&gt;&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/DIV&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2630:1-2631:47" dir="auto">The tag on the first line can be partial, as long
2023-01-13 00:05:48 +05:30
as it is split where there would be whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-123">Example 123</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2636:1-2640:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div id="foo"</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> class="bar"&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2642:1-2646:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div id="foo"</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> class="bar"&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-124">Example 124</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2653:1-2657:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div id="foo" class="bar</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> baz"&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2659:1-2663:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div id="foo" class="bar</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> baz"&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2667:1-2667:31" dir="auto">An open tag need not be closed:</p>
<div>
<div><a href="#example-125">Example 125</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2671:1-2676:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2678:1-2682:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*foo*</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2687:1-2688:17" dir="auto">A partial tag need not even be completed (garbage
2023-01-13 00:05:48 +05:30
in, garbage out):</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-126">Example 126</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2693:1-2696:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div id="foo"</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2698:1-2701:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div id="foo"</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*hi*</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-127">Example 127</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2708:1-2711:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div class</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2713:1-2716:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div class</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">foo</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2720:1-2721:35" dir="auto">The initial tag doesn't even need to be a valid
2023-01-13 00:05:48 +05:30
tag, as long as it starts like one:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-128">Example 128</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2726:1-2729:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div *???-&amp;&amp;&amp;-&lt;---</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2731:1-2734:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div *???-&amp;&amp;&amp;-&lt;---</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2738:1-2739:7" dir="auto">In type 6 blocks, the initial tag need not be on a line by
2023-01-13 00:05:48 +05:30
itself:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-129">Example 129</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2744:1-2746:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;&lt;a href="bar"&gt;*foo*&lt;/a&gt;&lt;/div&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2748:1-2750:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;&lt;a href="bar"&gt;*foo*&lt;/a&gt;&lt;/div&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-130">Example 130</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2757:1-2761:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;&lt;tr&gt;&lt;td&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2763:1-2767:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;&lt;tr&gt;&lt;td&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2771:1-2775:43" dir="auto">Everything until the next blank line or end of document
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-131">Example 131</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2780:1-2785:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;&lt;/div&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2787:1-2792:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;&lt;/div&gt;</span>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2796:1-2798:51" dir="auto">To start an [HTML block] with a tag that is <em>not</em> in the
2023-01-13 00:05:48 +05:30
list of block-level tags in (6), you must put the tag by
itself on the first line (and it must be complete):</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-132">Example 132</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2803:1-2807:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="foo"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*bar*</span>
<span id="LC3" class="line" lang="plaintext">&lt;/a&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2809:1-2813:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="foo"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*bar*</span>
<span id="LC3" class="line" lang="plaintext">&lt;/a&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2817:1-2817:49" dir="auto">In type 7 blocks, the [tag name] can be anything:</p>
<div>
<div><a href="#example-133">Example 133</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2822:1-2826:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;Warning&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*bar*</span>
<span id="LC3" class="line" lang="plaintext">&lt;/Warning&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2828:1-2832:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;Warning&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*bar*</span>
<span id="LC3" class="line" lang="plaintext">&lt;/Warning&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-134">Example 134</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2839:1-2843:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;i class="foo"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*bar*</span>
<span id="LC3" class="line" lang="plaintext">&lt;/i&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2845:1-2849:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;i class="foo"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*bar*</span>
<span id="LC3" class="line" lang="plaintext">&lt;/i&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-135">Example 135</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2856:1-2859:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;/ins&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2861:1-2864:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;/ins&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*bar*</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2868:1-2872:59" dir="auto">These rules are designed to allow us to work with tags that
2023-01-13 00:05:48 +05:30
can function as either block-level or inline-level tags.
The <code>&lt;del&gt;</code> tag is a nice example. We can surround content with
<code>&lt;del&gt;</code> tags in three different ways. In this case, we get a raw
HTML block, because the <code>&lt;del&gt;</code> tag is on a line by itself:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-136">Example 136</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2877:1-2881:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;del&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*foo*</span>
<span id="LC3" class="line" lang="plaintext">&lt;/del&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2883:1-2887:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;del&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*foo*</span>
<span id="LC3" class="line" lang="plaintext">&lt;/del&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2891:1-2893:54" dir="auto">In this case, we get a raw HTML block that just includes
2023-01-13 00:05:48 +05:30
the <code>&lt;del&gt;</code> tag (because it ends with the following blank
line). So the contents get interpreted as CommonMark:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-137">Example 137</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2898:1-2904:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;del&gt;</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/del&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2906:1-2910:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;del&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;/em&gt;&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/del&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2914:1-2917:29" dir="auto">Finally, in this case, the <code>&lt;del&gt;</code> tags are interpreted
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-138">Example 138</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2922:1-2924:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;del&gt;*foo*&lt;/del&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2926:1-2928:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;del&gt;&lt;em&gt;foo&lt;/em&gt;&lt;/del&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2932:1-2937:50" dir="auto">HTML tags designed to contain literal content
2023-01-13 00:05:48 +05:30
(<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="2939:1-2939:19" dir="auto">A pre tag (type 1):</p>
<div>
<div><a href="#example-139">Example 139</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2944:1-2952:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre language="haskell"&gt;&lt;code&gt;</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2954:1-2962:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre language="haskell"&gt;&lt;code&gt;</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;p&gt;okay&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2966:1-2966:22" dir="auto">A script tag (type 1):</p>
<div>
<div><a href="#example-140">Example 140</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2971:1-2978:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;script type="text/javascript"&gt;</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/script&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2980:1-2987:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;script type="text/javascript"&gt;</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/script&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;okay&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="2991:1-2991:21" dir="auto">A style tag (type 1):</p>
<div>
<div><a href="#example-141">Example 141</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="2996:1-3004:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;style</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> type="text/css"&gt;</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">&lt;/style&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3006:1-3014:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;style</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> type="text/css"&gt;</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">&lt;/style&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;p&gt;okay&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3018:1-3020:28" dir="auto">If there is no matching end tag, the block will end at the
2023-01-13 00:05:48 +05:30
end of the document (or the enclosing [block quote][block quotes]
or [list item][list items]):</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-142">Example 142</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3025:1-3030:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;style</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> type="text/css"&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3032:1-3037:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;style</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> type="text/css"&gt;</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>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-143">Example 143</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3044:1-3049:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; &lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; 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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3051:1-3057:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;div&gt;</span>
<span id="LC3" class="line" lang="plaintext">foo</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-144">Example 144</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3064:1-3067:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- &lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3069:1-3076:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;div&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3080:1-3080:56" dir="auto">The end tag can occur on the same line as the start tag:</p>
<div>
<div><a href="#example-145">Example 145</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3085:1-3088:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;style&gt;p{color:red;}&lt;/style&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3090:1-3093:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;style&gt;p{color:red;}&lt;/style&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;/em&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-146">Example 146</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3100:1-3103:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;!-- foo --&gt;*bar*</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3105:1-3108:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;!-- foo --&gt;*bar*</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;baz&lt;/em&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3112:1-3113:45" dir="auto">Note that anything on the last line after the
2023-01-13 00:05:48 +05:30
end tag will be included in the [HTML block]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-147">Example 147</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3118:1-3122:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;script&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;/script&gt;1. *bar*</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3124:1-3128:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;script&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;/script&gt;1. *bar*</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3132:1-3132:19" dir="auto">A comment (type 2):</p>
<div>
<div><a href="#example-148">Example 148</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">&lt;!-- Foo</span>
2023-01-13 00:05:48 +05:30
<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 --&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3145:1-3151:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;!-- Foo</span>
2023-01-13 00:05:48 +05:30
<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 --&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;okay&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3156:1-3156:34" dir="auto">A processing instruction (type 3):</p>
<div>
<div><a href="#example-149">Example 149</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3161:1-3168:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;?php</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext"> echo '&gt;';</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">?&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3170:1-3177:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;?php</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext"> echo '&gt;';</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">?&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;okay&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3181:1-3181:23" dir="auto">A declaration (type 4):</p>
<div>
<div><a href="#example-150">Example 150</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3186:1-3188:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;!DOCTYPE html&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3190:1-3192:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;!DOCTYPE html&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3196:1-3196:15" dir="auto">CDATA (type 5):</p>
<div>
<div><a href="#example-151">Example 151</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3201:1-3215:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;![CDATA[</span>
2023-01-13 00:05:48 +05:30
<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 &lt; b &amp;&amp; a &lt; 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">]]&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3217:1-3231:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;![CDATA[</span>
2023-01-13 00:05:48 +05:30
<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 &lt; b &amp;&amp; a &lt; 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">]]&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;p&gt;okay&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3235:1-3235:54" dir="auto">The opening tag can be indented 1-3 spaces, but not 4:</p>
<div>
<div><a href="#example-152">Example 152</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3240:1-3244:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &lt;!-- foo --&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext"> &lt;!-- foo --&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3246:1-3250:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &lt;!-- foo --&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&amp;lt;!-- foo --&amp;gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-153">Example 153</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3257:1-3261:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext"> &lt;div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3263:1-3267:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&amp;lt;div&amp;gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3271:1-3272:25" dir="auto">An HTML block of types 1--6 can interrupt a paragraph, and need not be
2023-01-13 00:05:48 +05:30
preceded by a blank line.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-154">Example 154</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3277:1-3282:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;div&gt;</span>
<span id="LC3" class="line" lang="plaintext">bar</span>
<span id="LC4" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3284:1-3289:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;div&gt;</span>
<span id="LC3" class="line" lang="plaintext">bar</span>
<span id="LC4" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3293:1-3295:7" dir="auto">However, a following blank line is needed, except at the end of
2023-01-13 00:05:48 +05:30
a document, and except for blocks of types 1--5, [above][HTML
block]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-155">Example 155</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3300:1-3305:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3307:1-3312:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</span>
<span id="LC4" class="line" lang="plaintext">*foo*</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3316:1-3316:51" dir="auto">HTML blocks of type 7 cannot interrupt a paragraph:</p>
<div>
<div><a href="#example-156">Example 156</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3321:1-3325:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;a href="bar"&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3327:1-3331:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;a href="bar"&gt;</span>
<span id="LC3" class="line" lang="plaintext">baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3335:1-3336:26" dir="auto">This rule differs from John Gruber's original Markdown syntax
2023-01-13 00:05:48 +05:30
specification, which says:</p>
2023-03-04 22:38:38 +05:30
<blockquote data-sourcepos="3338:1-3341:51" dir="auto">
<p data-sourcepos="3338:3-3341:51">The only restrictions are that block-level HTML elements —
2023-01-13 00:05:48 +05:30
e.g. <code>&lt;div&gt;</code>, <code>&lt;table&gt;</code>, <code>&lt;pre&gt;</code>, <code>&lt;p&gt;</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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="3343:1-3344:5" dir="auto">In some ways Gruber's rule is more restrictive than the one given
2023-01-13 00:05:48 +05:30
here:</p>
2023-03-04 22:38:38 +05:30
<ul data-sourcepos="3346:1-3350:0" dir="auto">
<li data-sourcepos="3346:1-3346:61">It requires that an HTML block be preceded by a blank line.</li>
<li data-sourcepos="3347:1-3347:49">It does not allow the start tag to be indented.</li>
<li data-sourcepos="3348:1-3350:0">It requires a matching end tag, which it also does not allow to
2023-01-13 00:05:48 +05:30
be indented.</li>
</ul>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="3351:1-3352:34" dir="auto">Most Markdown implementations (including some of Gruber's own) do not
2023-01-13 00:05:48 +05:30
respect all of these restrictions.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="3354:1-3361:61" dir="auto">There is one respect, however, in which Gruber's rule is more liberal
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="3363:1-3363:8" dir="auto">Compare:</p>
<div>
<div><a href="#example-157">Example 157</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3368:1-3374:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<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">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3376:1-3380:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;Emphasized&lt;/em&gt; text.&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-158">Example 158</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3387:1-3391:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*Emphasized* text.</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3393:1-3397:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*Emphasized* text.</span>
<span id="LC3" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3401:1-3405:22" dir="auto">Some Markdown implementations have adopted a convention of
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="3407:1-3410:59" dir="auto">The main potential drawback is that one can no longer paste HTML
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-159">Example 159</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3415:1-3427:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">&lt;td&gt;</span>
<span id="LC6" class="line" lang="plaintext">Hi</span>
<span id="LC7" class="line" lang="plaintext">&lt;/td&gt;</span>
<span id="LC8" class="line" lang="plaintext"></span>
<span id="LC9" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC10" class="line" lang="plaintext"></span>
<span id="LC11" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3429:1-3437:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC3" class="line" lang="plaintext">&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">&lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3441:1-3443:23" dir="auto">There are problems, however, if the inner tags are indented
2023-01-13 00:05:48 +05:30
<em>and</em> separated by spaces, as then they will be interpreted as
an indented code block:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-160">Example 160</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3448:1-3460:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext"> &lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext"> &lt;td&gt;</span>
<span id="LC6" class="line" lang="plaintext"> Hi</span>
<span id="LC7" class="line" lang="plaintext"> &lt;/td&gt;</span>
<span id="LC8" class="line" lang="plaintext"></span>
<span id="LC9" class="line" lang="plaintext"> &lt;/tr&gt;</span>
<span id="LC10" class="line" lang="plaintext"></span>
<span id="LC11" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3462:1-3471:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &lt;tr&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&amp;lt;td&amp;gt;</span>
<span id="LC4" class="line" lang="plaintext"> Hi</span>
<span id="LC5" class="line" lang="plaintext">&amp;lt;/td&amp;gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext"> &lt;/tr&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3475:1-3478:26" dir="auto">Fortunately, blank lines are usually not necessary and can be
2023-01-13 00:05:48 +05:30
deleted. The exception is inside <code>&lt;pre&gt;</code> tags, but as described
[above][HTML blocks], raw HTML blocks starting with <code>&lt;pre&gt;</code>
<em>can</em> contain blank lines.</p>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="3480:1-3480:29" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-link-reference-definitions" class="anchor" href="#link-reference-definitions" aria-hidden="true"></a>Link reference definitions</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="3482:1-3490:61" dir="auto">A <a href="@">link reference definition</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="3492:1-3497:5" dir="auto">A [link reference definition]
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-161">Example 161</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3502:1-3506:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3508:1-3510:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-162">Example 162</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3517:1-3523:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3525:1-3527:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="the title"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-163">Example 163</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3534:1-3538:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3540:1-3542:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="my_(url)" title="title (with parens)"&gt;Foo*bar]&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-164">Example 164</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3549:1-3555:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;my url&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3557:1-3559:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="my%20url" title="title"&gt;Foo bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3563:1-3563:41" dir="auto">The title may extend over multiple lines:</p>
<div>
<div><a href="#example-165">Example 165</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3568:1-3576:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3578:1-3584:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="</span>
2023-01-13 00:05:48 +05:30
<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">"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3588:1-3588:43" dir="auto">However, it may not contain a [blank line]:</p>
<div>
<div><a href="#example-166">Example 166</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3593:1-3599:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3601:1-3605:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo]: /url 'title&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;with blank line'&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;[foo]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3609:1-3609:25" dir="auto">The title may be omitted:</p>
<div>
<div><a href="#example-167">Example 167</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3614:1-3619:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3621:1-3623:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3627:1-3627:40" dir="auto">The link destination may not be omitted:</p>
<div>
<div><a href="#example-168">Example 168</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3632:1-3636:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3638:1-3641:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo]:&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;[foo]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3644:2-3645:16" dir="auto">However, an empty link destination may be specified using
2023-01-13 00:05:48 +05:30
angle brackets:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-169">Example 169</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3650:1-3654:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: &lt;&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3656:1-3658:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href=""&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3661:1-3662:11" dir="auto">The title must be separated from the link destination by
2023-01-13 00:05:48 +05:30
whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-170">Example 170</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3667:1-3671:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: &lt;bar&gt;(baz)</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3673:1-3676:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo]: &lt;bar&gt;(baz)&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;[foo]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3680:1-3681:24" dir="auto">Both title and destination can contain backslash escapes
2023-01-13 00:05:48 +05:30
and literal backslashes:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-171">Example 171</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3686:1-3690:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3692:1-3694:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url%5Cbar*baz" title="foo&amp;quot;bar\baz"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3698:1-3698:52" dir="auto">A link can come before its corresponding definition:</p>
<div>
<div><a href="#example-172">Example 172</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3703:1-3707:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3709:1-3711:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="url"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3715:1-3716:11" dir="auto">If there are several matching definitions, the first one takes
2023-01-13 00:05:48 +05:30
precedence:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-173">Example 173</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3721:1-3726:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3728:1-3730:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="first"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3734:1-3735:33" dir="auto">As noted in the section on [Links], matching of labels is
2023-01-13 00:05:48 +05:30
case-insensitive (see [matches]).</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-174">Example 174</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3740:1-3744:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3746:1-3748:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url"&gt;Foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-175">Example 175</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">[ΑΓΩ]: /φου</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3761:1-3763:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/%CF%86%CE%BF%CF%85"&gt;αγω&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3767:1-3768:39" dir="auto">Here is a link reference definition with no corresponding link.
2023-01-13 00:05:48 +05:30
It contributes nothing to the document.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-176">Example 176</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3773:1-3775:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3777:1-3778:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3782:1-3782:20" dir="auto">Here is another one:</p>
<div>
<div><a href="#example-177">Example 177</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3787:1-3792:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3794:1-3796:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3800:1-3801:44" dir="auto">This is not a link reference definition, because there are
2023-01-13 00:05:48 +05:30
[non-whitespace characters] after the title:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-178">Example 178</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3806:1-3808:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3810:1-3812:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo]: /url &amp;quot;title&amp;quot; ok&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3816:1-3816:57" dir="auto">This is a link reference definition, but it has no title:</p>
<div>
<div><a href="#example-179">Example 179</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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]: /url</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3826:1-3828:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;quot;title&amp;quot; ok&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3832:1-3833:12" dir="auto">This is not a link reference definition, because it is indented
2023-01-13 00:05:48 +05:30
four spaces:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-180">Example 180</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3838:1-3842:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3844:1-3848:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;[foo]: /url &amp;quot;title&amp;quot;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;[foo]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3852:1-3853:13" dir="auto">This is not a link reference definition, because it occurs inside
2023-01-13 00:05:48 +05:30
a code block:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-181">Example 181</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3858:1-3864:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3866:1-3870:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;[foo]: /url</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;[foo]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3874:1-3874:59" dir="auto">A [link reference definition] cannot interrupt a paragraph.</p>
<div>
<div><a href="#example-182">Example 182</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3879:1-3884:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3886:1-3890:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">[bar]: /baz&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;[bar]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3894:1-3895:65" dir="auto">However, it can directly follow other block elements, such as headings
2023-01-13 00:05:48 +05:30
and thematic breaks, and it need not be followed by a blank line.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-183">Example 183</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3900:1-3904:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">[foo]: /url</span>
<span id="LC3" class="line" lang="plaintext">&gt; bar</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3906:1-3911:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;&lt;a href="/url"&gt;Foo&lt;/a&gt;&lt;/h1&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-184">Example 184</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3917:1-3922:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3924:1-3927:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h1&gt;bar&lt;/h1&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-185">Example 185</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3933:1-3937:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3939:1-3942:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;===</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;a href="/url"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3946:1-3947:61" dir="auto">Several [link reference definitions]
2023-01-13 00:05:48 +05:30
can occur one after another, without intervening blank lines.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-186">Example 186</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3952:1-3961:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3963:1-3967:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/foo-url" title="foo"&gt;foo&lt;/a&gt;,</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;a href="/bar-url" title="bar"&gt;bar&lt;/a&gt;,</span>
<span id="LC3" class="line" lang="plaintext">&lt;a href="/baz-url"&gt;baz&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3971:1-3974:12" dir="auto">[Link reference definitions] can occur
2023-01-13 00:05:48 +05:30
inside block containers, like lists and block quotations. They
affect the entire document, not just the container in which they
are defined:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-187">Example 187</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3979:1-3983:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">&gt; [foo]: /url</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="3985: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">&lt;p&gt;&lt;a href="/url"&gt;foo&lt;/a&gt;&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="3993:1-3997:19" dir="auto">Whether something is a [link reference definition] is
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-188">Example 188</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4002:1-4004:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4006:1-4007:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="4011:1-4011:13" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-paragraphs" class="anchor" href="#paragraphs" aria-hidden="true"></a>Paragraphs</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4013:1-4018:13" dir="auto">A sequence of non-blank lines that cannot be interpreted as other
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4020:1-4020:37" dir="auto">A simple example with two paragraphs:</p>
<div>
<div><a href="#example-189">Example 189</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4025:1-4029:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4031:1-4034:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;aaa&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;bbb&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4038:1-4038:58" dir="auto">Paragraphs can contain multiple lines, but no blank lines:</p>
<div>
<div><a href="#example-190">Example 190</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4043:1-4049:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4051:1-4056:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bbb&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;ccc</span>
<span id="LC4" class="line" lang="plaintext">ddd&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4060:1-4060:54" dir="auto">Multiple blank lines between paragraph have no effect:</p>
<div>
<div><a href="#example-191">Example 191</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4065:1-4070:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4072:1-4075:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;aaa&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;bbb&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4079:1-4079:27" dir="auto">Leading spaces are skipped:</p>
<div>
<div><a href="#example-192">Example 192</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4084:1-4087:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4089:1-4092:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bbb&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4096:1-4097:40" dir="auto">Lines after the first may be indented any amount, since indented
2023-01-13 00:05:48 +05:30
code blocks cannot interrupt paragraphs.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-193">Example 193</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4102:1-4106:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4108:1-4112:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bbb</span>
<span id="LC3" class="line" lang="plaintext">ccc&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4116:1-4117:44" dir="auto">However, the first line may be indented at most three spaces,
2023-01-13 00:05:48 +05:30
or an indented code block will be triggered:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-194">Example 194</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4122:1-4125:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4127: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">&lt;p&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bbb&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-195">Example 195</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4137:1-4140:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4142:1-4146:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bbb&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4150:1-4152:7" dir="auto">Final spaces are stripped before inline parsing, so a paragraph
2023-01-13 00:05:48 +05:30
that ends with two or more spaces will not end with a [hard line
break]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-196">Example 196</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4157:1-4160:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4162:1-4165:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;aaa&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bbb&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="4169:1-4169:14" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-blank-lines" class="anchor" href="#blank-lines" aria-hidden="true"></a>Blank lines</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4171:1-4173:22" dir="auto">[Blank lines] between block-level elements are ignored,
2023-01-13 00:05:48 +05:30
except for the role they play in determining whether a [list]
is [tight] or [loose].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4175:1-4175:70" dir="auto">Blank lines at the beginning and end of the document are also ignored.</p>
<div>
<div><a href="#example-197">Example 197</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4180:1-4189:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4191:1-4194:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;aaa&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h1&gt;aaa&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
2023-01-13 00:05:48 +05:30
<div>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="4199:1-4199:21">
2023-01-13 00:05:48 +05:30
<a id="user-content-tables-extension" class="anchor" href="#tables-extension" aria-hidden="true"></a>Tables (extension)</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4201:1-4202:10">GFM enables the <code>table</code> extension, where an additional leaf block type is
2023-01-13 00:05:48 +05:30
available.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4204:1-4206:23">A <a href="@">table</a> is an arrangement of data with rows and columns, consisting of a
2023-01-13 00:05:48 +05:30
single header row, a [delimiter row] separating the header from the data, and
zero or more data rows.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4208:1-4212:23">Each row consists of cells containing arbitrary text, in which [inlines] are
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4214:1-4216:40">The <a href="@">delimiter row</a> consists of cells whose only content are hyphens (<code>-</code>),
2023-01-13 00:05:48 +05:30
and optionally, a leading or trailing colon (<code>:</code>), or both, to indicate left,
right, or center alignment respectively.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-198">Example 198</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4221:1-4225:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4227: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">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;thead&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;th&gt;foo&lt;/th&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;th&gt;bar&lt;/th&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/thead&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;tbody&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;td&gt;baz&lt;/td&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;td&gt;bim&lt;/td&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;/tbody&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4245:1-4246:74">Cells in one column don't need to match length, though it's easier to read if
2023-01-13 00:05:48 +05:30
they are. Likewise, use of leading and trailing pipes may be inconsistent:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-199">Example 199</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4251:1-4255:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4257:1-4272:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;thead&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;th align="center"&gt;abc&lt;/th&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;th align="right"&gt;defghi&lt;/th&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/thead&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;tbody&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;td align="center"&gt;bar&lt;/td&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;td align="right"&gt;baz&lt;/td&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;/tbody&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4275:1-4276:13">Include a pipe in a cell's content by escaping it, including inside other
2023-01-13 00:05:48 +05:30
inline spans:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-200">Example 200</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4281:1-4286:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4288:1-4304:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;thead&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;th&gt;f|oo&lt;/th&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/thead&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;tbody&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;td&gt;b &lt;code&gt;|&lt;/code&gt; az&lt;/td&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;td&gt;b &lt;strong&gt;|&lt;/strong&gt; im&lt;/td&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;/tbody&gt;</span>
<span id="LC15" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4307:1-4308:22">The table is broken at the first empty line, or beginning of another
2023-01-13 00:05:48 +05:30
block-level structure:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-201">Example 201</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4313:1-4318:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">&gt; bar</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4320:1-4338:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;thead&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;th&gt;abc&lt;/th&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;th&gt;def&lt;/th&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/thead&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;tbody&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;td&gt;bar&lt;/td&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;td&gt;baz&lt;/td&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;/tbody&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;/table&gt;</span>
<span id="LC15" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC16" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC17" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-202">Example 202</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4344:1-4351:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4353:1-4373:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;thead&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;th&gt;abc&lt;/th&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;th&gt;def&lt;/th&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/thead&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;tbody&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;td&gt;bar&lt;/td&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;td&gt;baz&lt;/td&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;td&gt;bar&lt;/td&gt;</span>
<span id="LC15" class="line" lang="plaintext">&lt;td&gt;&lt;/td&gt;</span>
<span id="LC16" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC17" class="line" lang="plaintext">&lt;/tbody&gt;</span>
<span id="LC18" class="line" lang="plaintext">&lt;/table&gt;</span>
<span id="LC19" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4376:1-4377:31">The header row must match the [delimiter row] in the number of cells. If not,
2023-01-13 00:05:48 +05:30
a table will not be recognized:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-203">Example 203</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4382:1-4386:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4388:1-4392:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;| abc | def |</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">| --- |</span>
<span id="LC3" class="line" lang="plaintext">| bar |&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4395:1-4397:65">The remainder of the table's rows may vary in the number of cells. If there
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-204">Example 204</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4402:1-4407:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4409:1-4428:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;thead&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;th&gt;abc&lt;/th&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;th&gt;def&lt;/th&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/thead&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;tbody&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;td&gt;bar&lt;/td&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;td&gt;&lt;/td&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;td&gt;bar&lt;/td&gt;</span>
<span id="LC15" class="line" lang="plaintext">&lt;td&gt;baz&lt;/td&gt;</span>
<span id="LC16" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC17" class="line" lang="plaintext">&lt;/tbody&gt;</span>
<span id="LC18" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4431:1-4431:75">If there are no rows in the body, no <code>&lt;tbody&gt;</code> is generated in HTML output:</p>
<div>
<div><a href="#example-205">Example 205</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4436:1-4439:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4441:1-4450:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;table&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;thead&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;tr&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;th&gt;abc&lt;/th&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;th&gt;def&lt;/th&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/tr&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/thead&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/table&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h1 data-sourcepos="4455:1-4455:18" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-container-blocks" class="anchor" href="#container-blocks" aria-hidden="true"></a>Container blocks</h1>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4457:1-4460:45" dir="auto">A <a href="#container-blocks">container block</a> is a block that has other
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4462:1-4463:26" dir="auto">We define the syntax for container blocks recursively. The general
2023-01-13 00:05:48 +05:30
form of the definition is:</p>
2023-03-04 22:38:38 +05:30
<blockquote data-sourcepos="4465:1-4467:35" dir="auto">
<p data-sourcepos="4465:3-4467:35">If X is a sequence of blocks, then the result of
2023-01-13 00:05:48 +05:30
transforming X in such-and-such a way is a container of type Y
with these blocks as its content.</p>
</blockquote>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4469:1-4473:52" dir="auto">So, we explain what counts as a block quote or list item by explaining
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="4475:1-4475:15" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-block-quotes" class="anchor" href="#block-quotes" aria-hidden="true"></a>Block quotes</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4477:1-4479:78" dir="auto">A <a href="@">block quote marker</a>
2023-01-13 00:05:48 +05:30
consists of 0-3 spaces of initial indent, plus (a) the character <code>&gt;</code> together
with a following space, or (b) a single character <code>&gt;</code> not followed by a space.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4481:1-4481:42" dir="auto">The following rules define [block quotes]:</p>
<ol data-sourcepos="4483:1-4500:0" dir="auto">
<li data-sourcepos="4483:1-4487:0">
<p data-sourcepos="4483:5-4486:54"><strong>Basic case.</strong> If a string of lines <em>Ls</em> constitute a sequence
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="4488:1-4497:0">
<p data-sourcepos="4488:5-4496:48"><strong>Laziness.</strong> If a string of lines <em>Ls</em> constitute a <a href="#block-quotes">block
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="4498:1-4500:0">
<p data-sourcepos="4498:5-4499:65"><strong>Consecutiveness.</strong> A document cannot contain two [block
2023-01-13 00:05:48 +05:30
quotes] in a row unless there is a [blank line] between them.</p>
</li>
</ol>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4501:1-4501:54" dir="auto">Nothing else counts as a <a href="#block-quotes">block quote</a>.</p>
<p data-sourcepos="4503:1-4503:25" dir="auto">Here is a simple example:</p>
<div>
<div><a href="#example-206">Example 206</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4508:1-4512:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; # Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; bar</span>
<span id="LC3" class="line" lang="plaintext">&gt; baz</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4514:1-4520:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h1&gt;Foo&lt;/h1&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar</span>
<span id="LC4" class="line" lang="plaintext">baz&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4524:1-4524:51" dir="auto">The spaces after the <code>&gt;</code> characters can be omitted:</p>
<div>
<div><a href="#example-207">Example 207</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4529:1-4533:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt;# Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt;bar</span>
<span id="LC3" class="line" lang="plaintext">&gt; baz</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4535:1-4541:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h1&gt;Foo&lt;/h1&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar</span>
<span id="LC4" class="line" lang="plaintext">baz&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4545:1-4545:46" dir="auto">The <code>&gt;</code> characters can be indented 1-3 spaces:</p>
<div>
<div><a href="#example-208">Example 208</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4550:1-4554:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &gt; # Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &gt; bar</span>
<span id="LC3" class="line" lang="plaintext"> &gt; baz</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4556:1-4562:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h1&gt;Foo&lt;/h1&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar</span>
<span id="LC4" class="line" lang="plaintext">baz&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4566:1-4566:34" dir="auto">Four spaces gives us a code block:</p>
<div>
<div><a href="#example-209">Example 209</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4571:1-4575:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &gt; # Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &gt; bar</span>
<span id="LC3" class="line" lang="plaintext"> &gt; baz</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4577:1-4582:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&amp;gt; # Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&amp;gt; bar</span>
<span id="LC3" class="line" lang="plaintext">&amp;gt; baz</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4586:1-4587:30" dir="auto">The Laziness clause allows us to omit the <code>&gt;</code> before
2023-01-13 00:05:48 +05:30
[paragraph continuation text]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-210">Example 210</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4592: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">&gt; # Foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; 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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4598:1-4604:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h1&gt;Foo&lt;/h1&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar</span>
<span id="LC4" class="line" lang="plaintext">baz&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4608:1-4609:19" dir="auto">A block quote can contain some lazy and some non-lazy
2023-01-13 00:05:48 +05:30
continuation lines:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-211">Example 211</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4614:1-4618:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; bar</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">baz</span>
<span id="LC3" class="line" lang="plaintext">&gt; foo</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4620:1-4626:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;bar</span>
<span id="LC3" class="line" lang="plaintext">baz</span>
<span id="LC4" class="line" lang="plaintext">foo&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4630:1-4632:61" dir="auto">Laziness only applies to lines that would have been continuations of
2023-01-13 00:05:48 +05:30
paragraphs had they been prepended with [block quote markers].
For example, the <code>&gt; </code> cannot be omitted in the second line of</p>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4634:1-4637: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">&gt; foo</span></span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="markdown"><span class="gt">&gt; ---</span></span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4639:1-4639:29" dir="auto">without changing the meaning:</p>
<div>
<div><a href="#example-212">Example 212</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4644:1-4647:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4649:1-4654:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4658:1-4658:52" dir="auto">Similarly, if we omit the <code>&gt; </code> in the second line of</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4660:1-4663: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">&gt; - foo</span></span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="markdown"><span class="gt">&gt; - bar</span></span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4665:1-4665:47" dir="auto">then the block quote ends after the first line:</p>
<div>
<div><a href="#example-213">Example 213</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4670:1-4673:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; - foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4675:1-4684:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4688:1-4689:53" dir="auto">For the same reason, we can't omit the <code>&gt; </code> in front of
2023-01-13 00:05:48 +05:30
subsequent lines of an indented or fenced code block:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-214">Example 214</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4694:1-4697:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4699:1-4706:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;bar</span>
<span id="LC6" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-215">Example 215</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4713:1-4717:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; ```</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4719:1-4725:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4729:1-4730:19" dir="auto">Note that in the following case, we have a [lazy
2023-01-13 00:05:48 +05:30
continuation line]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-216">Example 216</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4735:1-4738:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4740:1-4745:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">- bar&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4749:1-4749:24" dir="auto">To see why, note that in</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4751:1-4754: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">&gt; foo</span></span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="markdown"><span class="gt">&gt; - bar</span></span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4756:1-4758:61" dir="auto">the <code>- bar</code> is indented too far to start a list, and can't
2023-01-13 00:05:48 +05:30
be an indented code block because indented code blocks cannot
interrupt paragraphs, so it is [paragraph continuation text].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4760:1-4760:27" dir="auto">A block quote can be empty:</p>
<div>
<div><a href="#example-217">Example 217</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4765:1-4767:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4769:1-4772:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-218">Example 218</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4779:1-4783:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; </span>
<span id="LC3" class="line" lang="plaintext">&gt; </span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4785:1-4788:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4792:1-4792:52" dir="auto">A block quote can have initial or final blank lines:</p>
<div>
<div><a href="#example-219">Example 219</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4797:1-4801:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; foo</span>
<span id="LC3" class="line" lang="plaintext">&gt; </span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4803:1-4807:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4811:1-4811:43" dir="auto">A blank line always separates block quotes:</p>
<div>
<div><a href="#example-220">Example 220</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4816:1-4820:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">&gt; bar</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4822:1-4829:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4833:1-4836:44" dir="auto">(Most current Markdown implementations, including John Gruber's
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="4838:1-4839:28" dir="auto">Consecutiveness means that if we put these block quotes together,
2023-01-13 00:05:48 +05:30
we get a single block quote:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-221">Example 221</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4844:1-4847:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; bar</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4849:1-4854:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">bar&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4858:1-4858:46" dir="auto">To get a block quote with two paragraphs, use:</p>
<div>
<div><a href="#example-222">Example 222</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4863:1-4867:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt;</span>
<span id="LC3" class="line" lang="plaintext">&gt; bar</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4869: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">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4878:1-4878:38" dir="auto">Block quotes can interrupt paragraphs:</p>
<div>
<div><a href="#example-223">Example 223</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4883: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">foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; bar</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4888:1-4893:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4897:1-4898:7" dir="auto">In general, blank lines are not needed before or after block
2023-01-13 00:05:48 +05:30
quotes:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-224">Example 224</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4903:1-4907:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; aaa</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">***</span>
<span id="LC3" class="line" lang="plaintext">&gt; bbb</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4909:1-4917:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;aaa&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;hr /&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;bbb&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4921:1-4922:40" dir="auto">However, because of laziness, a blank line is needed between
2023-01-13 00:05:48 +05:30
a block quote and a following paragraph:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-225">Example 225</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4927:1-4930:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; bar</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4932:1-4937:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;bar</span>
<span id="LC3" class="line" lang="plaintext">baz&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-226">Example 226</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4944:1-4948:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; bar</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4950:1-4955:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-227">Example 227</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4962: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">&gt; bar</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt;</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">
2023-03-04 22:38:38 +05:30
<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">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="4977:1-4979:19" dir="auto">It is a consequence of the Laziness rule that any number
2023-01-13 00:05:48 +05:30
of initial <code>&gt;</code>s may be omitted on a continuation line of a
nested block quote:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-228">Example 228</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4984:1-4987:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; &gt; &gt; foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="4989:1-4998:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;foo</span>
<span id="LC5" class="line" lang="plaintext">bar&lt;/p&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-229">Example 229</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5005:1-5009:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt;&gt;&gt; foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; bar</span>
<span id="LC3" class="line" lang="plaintext">&gt;&gt;baz</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5011:1-5021:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;foo</span>
<span id="LC5" class="line" lang="plaintext">bar</span>
<span id="LC6" class="line" lang="plaintext">baz&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5025:1-5028:8" dir="auto">When including an indented code block in a block quote,
2023-01-13 00:05:48 +05:30
remember that the [block quote marker] includes
both the <code>&gt;</code> and a following space. So <em>five spaces</em> are needed after
the <code>&gt;</code>:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-230">Example 230</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5033:1-5037:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; code</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">&gt; not code</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5039:1-5047:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;code</span>
<span id="LC3" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;not code&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="5052:1-5052:13" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-list-items" class="anchor" href="#list-items" aria-hidden="true"></a>List items</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5054:1-5055:49" dir="auto">A <a href="@">list marker</a> is a
2023-01-13 00:05:48 +05:30
[bullet list marker] or an [ordered list marker].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5057:1-5058:32" dir="auto">A <a href="@">bullet list marker</a>
2023-01-13 00:05:48 +05:30
is a <code>-</code>, <code>+</code>, or <code>*</code> character.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5060:1-5064:18" dir="auto">An <a href="@">ordered list marker</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5066:1-5066:40" dir="auto">The following rules define [list items]:</p>
<ol data-sourcepos="5068:1-5087:0" dir="auto">
<li data-sourcepos="5068:1-5087:0">
<p data-sourcepos="5068:5-5076:45"><strong>Basic case.</strong> If a sequence of lines <em>Ls</em> constitute a sequence of
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5078:5-5078:15">Exceptions:</p>
<ol data-sourcepos="5080:5-5087:0">
<li data-sourcepos="5080:5-5084:57">When the first list item in a [list] interrupts
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="5085:5-5087:0">If any line is a [thematic break][thematic breaks] then
2023-01-13 00:05:48 +05:30
that line is not a list item.</li>
</ol>
</li>
</ol>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5088:1-5088:34" dir="auto">For example, let <em>Ls</em> be the lines</p>
<div>
<div><a href="#example-231">Example 231</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5093:1-5100:32" lang="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>
2023-01-13 00:05:48 +05:30
<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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5102:1-5110:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;A paragraph</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">with two lines.&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;indented code</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;A block quote.&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5114:1-5116:30" dir="auto">And let <em>M</em> be the marker <code>1.</code>, and <em>N</em> = 2. Then rule #1 says
2023-01-13 00:05:48 +05:30
that the following is an ordered list item with start number 1,
and the same contents as <em>Ls</em>:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-232">Example 232</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5121:1-5128:32" lang="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>
2023-01-13 00:05:48 +05:30
<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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5130:1-5142:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;A paragraph</span>
<span id="LC4" class="line" lang="plaintext">with two lines.&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;indented code</span>
<span id="LC6" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;p&gt;A block quote.&lt;/p&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5146:1-5152:5" dir="auto">The most important thing to notice is that the position of
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5154:1-5155:24" dir="auto">Here are some examples showing how far content must be indented to be
2023-01-13 00:05:48 +05:30
put under the list item:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-233">Example 233</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5160:1-5164:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5166:1-5171:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;one&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;two&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-234">Example 234</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5178:1-5182:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5184:1-5191:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;one&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;two&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-235">Example 235</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5198:1-5202:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5204:1-5210:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;one&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt; two</span>
<span id="LC5" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-236">Example 236</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5217:1-5221:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5223:1-5230:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;one&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;two&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5234:1-5240:13" dir="auto">It is tempting to think of this in terms of columns: the continuation
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-237">Example 237</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5245:1-5249:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> &gt; &gt; 1. one</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt;&gt;</span>
<span id="LC3" class="line" lang="plaintext">&gt;&gt; two</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5251:1-5262:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;ol&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;one&lt;/p&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;two&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/ol&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5266:1-5268:67" dir="auto">Here <code>two</code> occurs in the same column as the list marker <code>1.</code>,
2023-01-13 00:05:48 +05:30
but is actually contained in the list item, because there is
sufficient indentation after the last containing blockquote marker.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5270:1-5273:38" dir="auto">The converse is also possible. In the following example, the word <code>two</code>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-238">Example 238</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5278:1-5282:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt;&gt;- one</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt;&gt;</span>
<span id="LC3" class="line" lang="plaintext"> &gt; &gt; two</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5284:1-5293:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;one&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;two&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5297:1-5298:51" dir="auto">Note that at least one space is needed between the list marker and
2023-01-13 00:05:48 +05:30
any following content, so these are not list items:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-239">Example 239</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5303:1-5307:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5309:1-5312:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;-one&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;2.two&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5316:1-5317:15" dir="auto">A list item may contain blocks that are separated by more than
2023-01-13 00:05:48 +05:30
one blank line.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-240">Example 240</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5322:1-5327:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5329:1-5336:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5340:1-5340:42" dir="auto">A list item may contain any kind of block:</p>
<div>
<div><a href="#example-241">Example 241</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5345:1-5355:32" lang="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>
2023-01-13 00:05:48 +05:30
<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"> &gt; bam</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5357:1-5369:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;bar</span>
<span id="LC5" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;p&gt;bam&lt;/p&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5373:1-5374:43" dir="auto">A list item that contains an indented code block will preserve
2023-01-13 00:05:48 +05:30
empty lines within the code block verbatim.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-242">Example 242</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5379:1-5386:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5388:1-5399:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;Foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;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">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5402:1-5402:65" dir="auto">Note that ordered list start numbers must be nine digits or less:</p>
<div>
<div><a href="#example-243">Example 243</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5407:1-5409:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5411:1-5415:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol start="123456789"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;ok&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-244">Example 244</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5422:1-5424:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5426:1-5428:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;1234567890. not ok&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5432:1-5432:33" dir="auto">A start number may begin with 0s:</p>
<div>
<div><a href="#example-245">Example 245</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5437:1-5439:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5441:1-5445:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol start="0"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;ok&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-246">Example 246</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5452:1-5454:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5456:1-5460:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol start="3"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;ok&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5464:1-5464:35" dir="auto">A start number may not be negative:</p>
<div>
<div><a href="#example-247">Example 247</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5469:1-5471:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5473: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">&lt;p&gt;-1. not ok&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<ol start="2" data-sourcepos="5480:1-5490:0" dir="auto">
<li data-sourcepos="5480:1-5490:0">
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5491:1-5493:39" dir="auto">An indented code block will have to be indented four spaces beyond
2023-01-13 00:05:48 +05:30
the edge of the region where text will be included in the list item.
In the following case that is 6 spaces:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-248">Example 248</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5498:1-5502:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5504:1-5512:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;bar</span>
<span id="LC5" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5516:1-5516:33" dir="auto">And in this case it is 11 spaces:</p>
<div>
<div><a href="#example-249">Example 249</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5521:1-5525:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5527:1-5535:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol start="10"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;bar</span>
<span id="LC5" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5539:1-5541:12" dir="auto">If the <em>first</em> block in the list item is an indented code block,
2023-01-13 00:05:48 +05:30
then by rule #2, the contents must be indented <em>one</em> space after the
list marker:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-250">Example 250</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5546:1-5552:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5554:1-5560:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;indented code</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;paragraph&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;more code</span>
<span id="LC5" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-251">Example 251</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5567:1-5573:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5575:1-5585:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;indented code</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;paragraph&lt;/p&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;more code</span>
<span id="LC7" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5589:1-5590:22" dir="auto">Note that an additional space indent is interpreted as space
2023-01-13 00:05:48 +05:30
inside the code block:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-252">Example 252</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5595:1-5601:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5603:1-5613:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt; indented code</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;paragraph&lt;/p&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;more code</span>
<span id="LC7" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5617:1-5623:55" dir="auto">Note that rules #1 and #2 only apply to two cases: (a) cases
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-253">Example 253</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5628:1-5632:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5634:1-5637:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-254">Example 254</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5644:1-5648:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5650:1-5655:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5659:1-5662:15" dir="auto">This is not a significant restriction, because when a block begins
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-255">Example 255</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5667:1-5671:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5673:1-5680:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<ol start="3" data-sourcepos="5684:1-5695:0" dir="auto">
<li data-sourcepos="5684:1-5695:0">
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5696:1-5696:72" dir="auto">Here are some list items that start with a blank line but are not empty:</p>
<div>
<div><a href="#example-256">Example 256</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5701:1-5710:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5712:1-5724:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;bar</span>
<span id="LC5" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;baz</span>
<span id="LC9" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5727:1-5728:66" dir="auto">When the list item starts with a blank line, the number of spaces
2023-01-13 00:05:48 +05:30
following the list marker doesn't change the required indentation:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-257">Example 257</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5733:1-5736:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5738:1-5742:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5746:1-5748:5" dir="auto">A list item can begin with at most one blank line.
2023-01-13 00:05:48 +05:30
In the following example, <code>foo</code> is not part of the list
item:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-258">Example 258</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5753:1-5757:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5759:1-5764:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5768:1-5768:34" dir="auto">Here is an empty bullet list item:</p>
<div>
<div><a href="#example-259">Example 259</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5773: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">- foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5779:1-5785:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5789:1-5789:72" dir="auto">It does not matter whether there are spaces following the [list marker]:</p>
<div>
<div><a href="#example-260">Example 260</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5794:1-5798:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5800:1-5806:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5810:1-5810:35" dir="auto">Here is an empty ordered list item:</p>
<div>
<div><a href="#example-261">Example 261</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5815:1-5819:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5821:1-5827:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5831:1-5831:48" dir="auto">A list may start or end with an empty list item:</p>
<div>
<div><a href="#example-262">Example 262</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5836:1-5838:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5840:1-5844:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5847:1-5847:57" dir="auto">However, an empty list item cannot interrupt a paragraph:</p>
<div>
<div><a href="#example-263">Example 263</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5852:1-5858:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5860: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">&lt;p&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo</span>
<span id="LC4" class="line" lang="plaintext">1.&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<ol start="4" data-sourcepos="5869:1-5874:0" dir="auto">
<li data-sourcepos="5869:1-5874:0">
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="5875:1-5875:19" dir="auto">Indented one space:</p>
<div>
<div><a href="#example-264">Example 264</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5880:1-5887:32" lang="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>
2023-01-13 00:05:48 +05:30
<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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5889:1-5901:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;A paragraph</span>
<span id="LC4" class="line" lang="plaintext">with two lines.&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;indented code</span>
<span id="LC6" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;p&gt;A block quote.&lt;/p&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5905:1-5905:20" dir="auto">Indented two spaces:</p>
<div>
<div><a href="#example-265">Example 265</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5910:1-5917:32" lang="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>
2023-01-13 00:05:48 +05:30
<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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5919:1-5931:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;A paragraph</span>
<span id="LC4" class="line" lang="plaintext">with two lines.&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;indented code</span>
<span id="LC6" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;p&gt;A block quote.&lt;/p&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5935:1-5935:22" dir="auto">Indented three spaces:</p>
<div>
<div><a href="#example-266">Example 266</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5940:1-5947:32" lang="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>
2023-01-13 00:05:48 +05:30
<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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5949:1-5961:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;A paragraph</span>
<span id="LC4" class="line" lang="plaintext">with two lines.&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;indented code</span>
<span id="LC6" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;p&gt;A block quote.&lt;/p&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="5965:1-5965:38" dir="auto">Four spaces indent gives a code block:</p>
<div>
<div><a href="#example-267">Example 267</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5970:1-5977:32" lang="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>
2023-01-13 00:05:48 +05:30
<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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="5979:1-5987:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;1. A paragraph</span>
2023-01-13 00:05:48 +05:30
<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"> &amp;gt; A block quote.</span>
<span id="LC7" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<ol start="5" data-sourcepos="5992:1-6000:0" dir="auto">
<li data-sourcepos="5992:1-6000:0">
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6001:1-6001:50" dir="auto">Here is an example with [lazy continuation lines]:</p>
<div>
<div><a href="#example-268">Example 268</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6006:1-6013:32" lang="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>
2023-01-13 00:05:48 +05:30
<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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6015:1-6027:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;A paragraph</span>
<span id="LC4" class="line" lang="plaintext">with two lines.&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;indented code</span>
<span id="LC6" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;p&gt;A block quote.&lt;/p&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6031:1-6031:37" dir="auto">Indentation can be partially deleted:</p>
<div>
<div><a href="#example-269">Example 269</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6036:1-6039:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6041:1-6046:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;A paragraph</span>
<span id="LC3" class="line" lang="plaintext">with two lines.&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6050:1-6050:63" dir="auto">These examples show how laziness can work in nested structures:</p>
<div>
<div><a href="#example-270">Example 270</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6055:1-6058:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; 1. &gt; Blockquote</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6060:1-6071:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;ol&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;Blockquote</span>
<span id="LC6" class="line" lang="plaintext">continued here.&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ol&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-271">Example 271</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6078:1-6081:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; 1. &gt; Blockquote</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&gt; continued here.</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6083:1-6094:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;blockquote&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;ol&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;Blockquote</span>
<span id="LC6" class="line" lang="plaintext">continued here.&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ol&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<ol start="6" data-sourcepos="6099:1-6101:0" dir="auto">
<li data-sourcepos="6099:1-6101:0">
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6102:1-6105:17" dir="auto">The rules for sublists follow from the general rules
2023-01-13 00:05:48 +05:30
[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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6107:1-6107:43" dir="auto">So, in this case we need two spaces indent:</p>
<div>
<div><a href="#example-272">Example 272</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6112:1-6117:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6119: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">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;bar</span>
<span id="LC5" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;baz</span>
<span id="LC7" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;li&gt;boo&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC15" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6139:1-6139:18" dir="auto">One is not enough:</p>
<div>
<div><a href="#example-273">Example 273</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6144:1-6149:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6151:1-6158:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;baz&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;boo&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6162:1-6162:52" dir="auto">Here we need four, because the list marker is wider:</p>
<div>
<div><a href="#example-274">Example 274</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6167: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">10) foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6172:1-6180:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol start="10"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6184:1-6184:20" dir="auto">Three is not enough:</p>
<div>
<div><a href="#example-275">Example 275</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6189:1-6192:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6194:1-6201:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol start="10"&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ol&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6205:1-6205:45" dir="auto">A list may be the first block in a list item:</p>
<div>
<div><a href="#example-276">Example 276</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6210:1-6212:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6214:1-6222:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-277">Example 277</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6229:1-6231:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6233:1-6245:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;ol start="2"&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ol&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6249:1-6249:34" dir="auto">A list item can contain a heading:</p>
<div>
<div><a href="#example-278">Example 278</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6254:1-6259:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6261:1-6270:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h1&gt;Foo&lt;/h1&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;h2&gt;Bar&lt;/h2&gt;</span>
<span id="LC7" class="line" lang="plaintext">baz&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h3 data-sourcepos="6274:1-6274:14" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-motivation" class="anchor" href="#motivation" aria-hidden="true"></a>Motivation</h3>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6276:1-6276:64" dir="auto">John Gruber's Markdown spec says the following about list items:</p>
<ol data-sourcepos="6278:1-6297:0" dir="auto">
<li data-sourcepos="6278:1-6281:0">
<p data-sourcepos="6278:4-6280:20">"List markers typically start at the left margin, but may be indented
2023-01-13 00:05:48 +05:30
by up to three spaces. List markers must be followed by one or more
spaces or a tab."</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="6282:1-6284:0">
<p data-sourcepos="6282:4-6283:48">"To make lists look nice, you can wrap items with hanging indents....
2023-01-13 00:05:48 +05:30
But if you don't want to, you don't have to."</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="6285:1-6288:0">
<p data-sourcepos="6285:4-6287:8">"List items may consist of multiple paragraphs. Each subsequent
2023-01-13 00:05:48 +05:30
paragraph in a list item must be indented by either 4 spaces or one
tab."</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="6289:1-6291:0">
<p data-sourcepos="6289:4-6290:55">"It looks nice if you indent every line of the subsequent paragraphs,
2023-01-13 00:05:48 +05:30
but here again, Markdown will allow you to be lazy."</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="6292:1-6294:0">
<p data-sourcepos="6292:4-6293:35">"To put a blockquote within a list item, the blockquote's <code>&gt;</code>
2023-01-13 00:05:48 +05:30
delimiters need to be indented."</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="6295:1-6297:0">
<p data-sourcepos="6295:4-6296:44">"To put a code block within a list item, the code block needs to be
2023-01-13 00:05:48 +05:30
indented twice — 8 spaces or two tabs."</p>
</li>
</ol>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6298:1-6307:18" dir="auto">These rules specify that a paragraph under a list item must be indented
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6309:1-6320:48" dir="auto">The four-space rule is clear and principled, and if the reference
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6322:1-6327:45" dir="auto">Unfortunately, given the divergences between implementations, there
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6329:1-6335:22" dir="auto">The strategy here is to let the width and indentation of the list marker
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6337:1-6339:39" dir="auto">This rule is superior, we claim, to any rule requiring a fixed level of
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6341:1-6347: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6349:1-6349:60" dir="auto">should be parsed as two lists with an intervening paragraph,</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6351:1-6359: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">&lt;ul&gt;</span></span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="html"><span class="nt">&lt;li&gt;</span>foo<span class="nt">&lt;/li&gt;</span></span>
<span id="LC3" class="line" lang="html"><span class="nt">&lt;/ul&gt;</span></span>
<span id="LC4" class="line" lang="html"><span class="nt">&lt;p&gt;</span>bar<span class="nt">&lt;/p&gt;</span></span>
<span id="LC5" class="line" lang="html"><span class="nt">&lt;ul&gt;</span></span>
<span id="LC6" class="line" lang="html"><span class="nt">&lt;li&gt;</span>baz<span class="nt">&lt;/li&gt;</span></span>
<span id="LC7" class="line" lang="html"><span class="nt">&lt;/ul&gt;</span></span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6361:1-6361:58" dir="auto">as the four-space rule demands, rather than a single list,</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6363:1-6373: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">&lt;ul&gt;</span></span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="html"><span class="nt">&lt;li&gt;</span></span>
<span id="LC3" class="line" lang="html"><span class="nt">&lt;p&gt;</span>foo<span class="nt">&lt;/p&gt;</span></span>
<span id="LC4" class="line" lang="html"><span class="nt">&lt;p&gt;</span>bar<span class="nt">&lt;/p&gt;</span></span>
<span id="LC5" class="line" lang="html"><span class="nt">&lt;ul&gt;</span></span>
<span id="LC6" class="line" lang="html"><span class="nt">&lt;li&gt;</span>baz<span class="nt">&lt;/li&gt;</span></span>
<span id="LC7" class="line" lang="html"><span class="nt">&lt;/ul&gt;</span></span>
<span id="LC8" class="line" lang="html"><span class="nt">&lt;/li&gt;</span></span>
<span id="LC9" class="line" lang="html"><span class="nt">&lt;/ul&gt;</span></span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6375:1-6376:62" dir="auto">The choice of four spaces is arbitrary. It can be learned, but it is
2023-01-13 00:05:48 +05:30
not likely to be guessed, and it trips up beginners regularly.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6378:1-6382:20" dir="auto">Would it help to adopt a two-space rule? The problem is that such
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6384:1-6388: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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="markdown"></span>
<span id="LC3" class="line" lang="markdown"> two</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6390:1-6390:59" dir="auto">as a single list item, with <code>two</code> a continuation paragraph:</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6392:1-6399: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">&lt;ul&gt;</span></span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="html"><span class="nt">&lt;li&gt;</span></span>
<span id="LC3" class="line" lang="html"><span class="nt">&lt;p&gt;</span>one<span class="nt">&lt;/p&gt;</span></span>
<span id="LC4" class="line" lang="html"><span class="nt">&lt;p&gt;</span>two<span class="nt">&lt;/p&gt;</span></span>
<span id="LC5" class="line" lang="html"><span class="nt">&lt;/li&gt;</span></span>
<span id="LC6" class="line" lang="html"><span class="nt">&lt;/ul&gt;</span></span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6401:1-6401:13" dir="auto">and similarly</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6403:1-6407: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">&gt; - one</span></span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="markdown"><span class="gt">&gt;</span></span>
<span id="LC3" class="line" lang="markdown"><span class="gt">&gt; two</span></span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6409:1-6409:2" dir="auto">as</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6411:1-6420: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">&lt;blockquote&gt;</span></span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="html"><span class="nt">&lt;ul&gt;</span></span>
<span id="LC3" class="line" lang="html"><span class="nt">&lt;li&gt;</span></span>
<span id="LC4" class="line" lang="html"><span class="nt">&lt;p&gt;</span>one<span class="nt">&lt;/p&gt;</span></span>
<span id="LC5" class="line" lang="html"><span class="nt">&lt;p&gt;</span>two<span class="nt">&lt;/p&gt;</span></span>
<span id="LC6" class="line" lang="html"><span class="nt">&lt;/li&gt;</span></span>
<span id="LC7" class="line" lang="html"><span class="nt">&lt;/ul&gt;</span></span>
<span id="LC8" class="line" lang="html"><span class="nt">&lt;/blockquote&gt;</span></span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6422:1-6422:30" dir="auto">This is extremely unintuitive.</p>
<p data-sourcepos="6424:1-6429:52" dir="auto">Rather than requiring a fixed indent from the margin, we could require
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6431:1-6435: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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="markdown"></span>
<span id="LC3" class="line" lang="markdown"> bar </span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6437:1-6440:62" dir="auto">Arguably this text does read like a list item with <code>bar</code> as a subparagraph,
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6442:1-6446: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6448:1-6450:28" dir="auto">where the code is indented eight spaces. The spec above, by contrast, will
2023-01-13 00:05:48 +05:30
parse this text as expected, since the code block's indentation is measured
from the beginning of <code>foo</code>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6452:1-6458:62" dir="auto">The one case that needs special treatment is a list item that <em>starts</em>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="6462:1-6462:30">
2023-01-13 00:05:48 +05: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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6464:1-6465:26">GFM enables the <code>tasklist</code> extension, where an additional processing step is
2023-01-13 00:05:48 +05:30
performed on [list items].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6467:1-6469:46">A <a href="@">task list item</a> is a [list item][list items] where the first block in it
2023-01-13 00:05:48 +05:30
is a paragraph which begins with a [task list item marker] and at least one
whitespace character before any other content.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6471:1-6473:55">A <a href="@">task list item marker</a> consists of an optional number of spaces, a left
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6475:1-6476:70">When rendered, the [task list item marker] is replaced with a semantic checkbox element;
2023-01-13 00:05:48 +05:30
in an HTML output, this would be an <code>&lt;input type="checkbox"&gt;</code> element.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6478:1-6479:50">If the character between the brackets is a whitespace character, the checkbox
2023-01-13 00:05:48 +05:30
is unchecked. Otherwise, the checkbox is checked.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6481:1-6484:28">This spec does not define how the checkbox elements are interacted with: in practice,
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-279">Example 279</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6489:1-6492:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6494:1-6499:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;&lt;input checked="" disabled="" type="checkbox"&gt; bar&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6502:1-6502:37">Task lists can be arbitrarily nested:</p>
<div>
<div><a href="#example-280">Example 280</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6507:1-6512:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6514:1-6524:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;&lt;input checked="" disabled="" type="checkbox"&gt; foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; bar&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;&lt;input checked="" disabled="" type="checkbox"&gt; baz&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;li&gt;&lt;input disabled="" type="checkbox"&gt; bim&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="6529:1-6529:8" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-lists" class="anchor" href="#lists" aria-hidden="true"></a>Lists</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6531:1-6533:46" dir="auto">A <a href="@">list</a> is a sequence of one or more
2023-01-13 00:05:48 +05:30
list items [of the same type]. The list items
may be separated by any number of blank lines.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6535:1-6540:30" dir="auto">Two list items are <a href="@">of the same type</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6542:1-6546:39" dir="auto">A list is an <a href="@">ordered list</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6548:1-6551:12" dir="auto">The <a href="@">start number</a>
2023-01-13 00:05:48 +05:30
of an [ordered list] is determined by the list number of
its initial list item. The numbers of subsequent list items are
disregarded.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6553:1-6558:65" dir="auto">A list is <a href="@">loose</a> if any of its constituent
2023-01-13 00:05:48 +05:30
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>&lt;p&gt;</code> tags, while paragraphs in a tight list are not.)</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6560:1-6560:64" dir="auto">Changing the bullet or ordered list delimiter starts a new list:</p>
<div>
<div><a href="#example-281">Example 281</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6565:1-6569:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6571:1-6579:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;baz&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-282">Example 282</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6586:1-6590:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6592:1-6600:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ol&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;ol start="3"&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;baz&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6604:1-6606:5" dir="auto">In CommonMark, a list can interrupt a paragraph. That is,
2023-01-13 00:05:48 +05:30
no blank line is needed to separate a paragraph from a following
list:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-283">Example 283</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6611:1-6615:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6617:1-6623:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;baz&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6626:1-6627:37" dir="auto"><code>Markdown.pl</code> does not allow this, through fear of triggering a list
2023-01-13 00:05:48 +05:30
via a numeral in a hard-wrapped line:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6629:1-6632: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6634:1-6636:6" dir="auto">Oddly, though, <code>Markdown.pl</code> <em>does</em> allow a blockquote to
2023-01-13 00:05:48 +05:30
interrupt a paragraph, even though the same considerations might
apply.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6638:1-6640:35" dir="auto">In CommonMark, we do allow lists to interrupt paragraphs, for
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6642:1-6647: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6649:1-6649:29" dir="auto">Second, we are attracted to a</p>
<blockquote data-sourcepos="6651:1-6654:54" dir="auto">
<p data-sourcepos="6651:3-6654:54"><a href="@">principle of uniformity</a>:
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6656:1-6657:47" dir="auto">(Indeed, the spec for [list items] and [block quotes] presupposes
2023-01-13 00:05:48 +05:30
this principle.) This principle implies that if</p>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6659:1-6664: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6666:1-6669:4" dir="auto">is a list item containing a paragraph followed by a nested sublist,
2023-01-13 00:05:48 +05:30
as all Markdown implementations agree it is (though the paragraph
may be rendered without <code>&lt;p&gt;</code> tags, since the list is "tight"),
then</p>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6671:1-6676: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6678:1-6678:61" dir="auto">by itself should be a paragraph followed by a nested sublist.</p>
<p data-sourcepos="6680:1-6685:30" dir="auto">Since it is well established Markdown practice to allow lists to
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="6687:1-6689:28" dir="auto">In order to solve of unwanted lists in paragraphs with
2023-01-13 00:05:48 +05:30
hard-wrapped numerals, we allow only lists starting with <code>1</code> to
interrupt paragraphs. Thus,</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-284">Example 284</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6694:1-6697:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6699:1-6702:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;The number of windows in my house is</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">14. The number of doors is 6.&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6705:1-6705:51" dir="auto">We may still get an unintended result in cases like</p>
<div>
<div><a href="#example-285">Example 285</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6710:1-6713:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6715:1-6720:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;The number of windows in my house is&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;ol&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;The number of doors is 6.&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6723:1-6723:57" dir="auto">but this rule should prevent most spurious list captures.</p>
<p data-sourcepos="6725:1-6725:53" dir="auto">There can be any number of blank lines between items:</p>
<div>
<div><a href="#example-286">Example 286</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6730:1-6737:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6739:1-6751:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-287">Example 287</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6757:1-6764:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6766:1-6781:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;bar</span>
<span id="LC5" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;p&gt;bim&lt;/p&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6785:1-6788:8" dir="auto">To separate consecutive lists of the same type, or to separate a
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-288">Example 288</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6793:1-6801:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">- bar</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext">&lt;!-- --&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6803:1-6813:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;!-- --&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;li&gt;baz&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;li&gt;bim&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-289">Example 289</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6820:1-6830:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">&lt;!-- --&gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6832:1-6845:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;notcode&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;!-- --&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;code</span>
<span id="LC12" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6849:1-6852:5" dir="auto">List items need not be indented to the same level. The following
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-290">Example 290</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6857:1-6865:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6867:1-6877:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;a&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;b&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;c&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;d&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;e&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;li&gt;f&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;li&gt;g&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-291">Example 291</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6884:1-6890:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6892:1-6904:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;a&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;b&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;p&gt;c&lt;/p&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6907:1-6909:52" dir="auto">Note, however, that list items may not be indented more than
2023-01-13 00:05:48 +05:30
three spaces. Here <code>- e</code> is treated as a paragraph continuation
line, because it is indented more than three spaces:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-292">Example 292</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6914:1-6920:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6922:1-6930:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;a&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;b&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;c&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;d</span>
<span id="LC6" class="line" lang="plaintext">- e&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6933:1-6935:11" dir="auto">And here, <code>3. c</code> is treated as in indented code block,
2023-01-13 00:05:48 +05:30
because it is indented four spaces and preceded by a
blank line.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-293">Example 293</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6940:1-6946:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6948:1-6959:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;a&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;b&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/ol&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;3. c</span>
<span id="LC10" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6963:1-6964:22" dir="auto">This is a loose list, because there is a blank line between
2023-01-13 00:05:48 +05:30
two of the list items:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-294">Example 294</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6969:1-6974:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6976:1-6988:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;a&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;b&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;p&gt;c&lt;/p&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="6992:1-6992:37" dir="auto">So is this, with a empty second item:</p>
<div>
<div><a href="#example-295">Example 295</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="6997: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">* a</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7004:1-7014:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;a&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;p&gt;c&lt;/p&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7018:1-7020:31" dir="auto">These are loose lists, even though there is no space between the items,
2023-01-13 00:05:48 +05:30
because one of the items directly contains two block-level elements
with a blank line between them:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-296">Example 296</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7025:1-7031:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7033:1-7046:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;a&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;b&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;p&gt;c&lt;/p&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;p&gt;d&lt;/p&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-297">Example 297</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7053:1-7059:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7061: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">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;a&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;b&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;p&gt;d&lt;/p&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7077:1-7077:66" dir="auto">This is a tight list, because the blank lines are in a code block:</p>
<div>
<div><a href="#example-298">Example 298</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7082:1-7090:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7092:1-7103:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;a&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;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">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;li&gt;c&lt;/li&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7107:1-7109:24" dir="auto">This is a tight list, because the blank line is between two
2023-01-13 00:05:48 +05:30
paragraphs of a sublist. So the sublist is loose while
the outer list is tight:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-299">Example 299</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7114:1-7120:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7122:1-7134:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;a</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;b&lt;/p&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;p&gt;c&lt;/p&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;li&gt;d&lt;/li&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7138:1-7139:12" dir="auto">This is a tight list, because the blank line is inside the
2023-01-13 00:05:48 +05:30
block quote:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-300">Example 300</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7144:1-7149:32" lang="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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &gt; b</span>
<span id="LC3" class="line" lang="plaintext"> &gt;</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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7151:1-7160:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;a</span>
<span id="LC3" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;b&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;li&gt;c&lt;/li&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7164:1-7165:33" dir="auto">This list is tight, because the consecutive block elements
2023-01-13 00:05:48 +05:30
are not separated by blank lines:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-301">Example 301</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7170:1-7177:32" lang="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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &gt; 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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7179: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">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;a</span>
<span id="LC3" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;b&lt;/p&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;c</span>
<span id="LC7" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;li&gt;d&lt;/li&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7194:1-7194:33" dir="auto">A single-paragraph list is tight:</p>
<div>
<div><a href="#example-302">Example 302</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7199:1-7201:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7203:1-7207:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;a&lt;/li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-303">Example 303</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7214:1-7217:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7219:1-7227:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;a</span>
<span id="LC3" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;li&gt;b&lt;/li&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7231:1-7232:36" dir="auto">This list is loose, because of the blank line between the
2023-01-13 00:05:48 +05:30
two block elements in the list item:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-304">Example 304</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7237:1-7243:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7245: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">&lt;ol&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;foo</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;p&gt;bar&lt;/p&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ol&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7257:1-7257:51" dir="auto">Here the outer list is loose, the inner list tight:</p>
<div>
<div><a href="#example-305">Example 305</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7262:1-7267:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7269:1-7279:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;bar&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;p&gt;baz&lt;/p&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-306">Example 306</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7286:1-7294:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7296:1-7313:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;a&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;li&gt;b&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;li&gt;c&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;p&gt;d&lt;/p&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;li&gt;e&lt;/li&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;li&gt;f&lt;/li&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;/ul&gt;</span>
<span id="LC15" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC16" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h1 data-sourcepos="7317:1-7317:9" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-inlines" class="anchor" href="#inlines" aria-hidden="true"></a>Inlines</h1>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7319:1-7321:21" dir="auto">Inlines are parsed sequentially from the beginning of the character
2023-01-13 00:05:48 +05:30
stream to the end (left to right, in left-to-right languages).
Thus, for example, in</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-307">Example 307</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7326:1-7328:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7330:1-7332:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;hi&lt;/code&gt;lo`&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7335:1-7336:9" dir="auto"><code>hi</code> is parsed as code, leaving the backtick at the end as a literal
2023-01-13 00:05:48 +05:30
backtick.</p>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="7339:1-7339:20" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-backslash-escapes" class="anchor" href="#backslash-escapes" aria-hidden="true"></a>Backslash escapes</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7341:1-7341:57" dir="auto">Any ASCII punctuation character may be backslash-escaped:</p>
<div>
<div><a href="#example-308">Example 308</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7346:1-7348:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\!\"\#\$\%\&amp;\'\(\)\*\+\,\-\.\/\:\;\&lt;\=\&gt;\?\@\[\\\]\^\_\`\{\|\}\~</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7350:1-7352:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;!&amp;quot;#$%&amp;amp;'()*+,-./:;&amp;lt;=&amp;gt;?@[\]^_`{|}~&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7356:1-7357:12" dir="auto">Backslashes before other characters are treated as literal
2023-01-13 00:05:48 +05:30
backslashes:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-309">Example 309</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7362:1-7364:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7366:1-7368:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;\→\A\a\ \3\φ\«&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7372:1-7373:39" dir="auto">Escaped characters are treated as regular characters and do
2023-01-13 00:05:48 +05:30
not have their usual Markdown meanings:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-310">Example 310</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7378:1-7388:32" lang="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>
2023-01-13 00:05:48 +05:30
<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 "not a reference"</span>
2023-03-17 16:20:25 +05:30
<span id="LC9" class="line" lang="plaintext">\ö not a character entity</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7390: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">&lt;p&gt;*not emphasized*</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&amp;lt;br/&amp;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 &amp;quot;not a reference&amp;quot;</span>
<span id="LC9" class="line" lang="plaintext">&amp;amp;ouml; not a character entity&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7404:1-7404:65" dir="auto">If a backslash is itself escaped, the following character is not:</p>
<div>
<div><a href="#example-311">Example 311</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7409:1-7411:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7413:1-7415:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;\&lt;em&gt;emphasis&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7419:1-7419:58" dir="auto">A backslash at the end of the line is a [hard line break]:</p>
<div>
<div><a href="#example-312">Example 312</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7424:1-7427:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7429:1-7432:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7436:1-7437:9" dir="auto">Backslash escapes do not work in code blocks, code spans, autolinks, or
2023-01-13 00:05:48 +05:30
raw HTML:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-313">Example 313</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7442:1-7444:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7446:1-7448:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;\[\`&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-314">Example 314</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7455:1-7457:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7459:1-7462:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;\[\]</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-315">Example 315</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7469:1-7473:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7475:1-7478:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;\[\]</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-316">Example 316</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7485:1-7487:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;http://example.com?find=\*&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7489:1-7491:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://example.com?find=%5C*"&gt;http://example.com?find=\*&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-317">Example 317</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7498:1-7500:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="/bar\/)"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7502: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">&lt;a href="/bar\/)"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7508:1-7509:60" dir="auto">But they work in all other contexts, including URLs and link titles,
2023-01-13 00:05:48 +05:30
link references, and [info strings] in [fenced code blocks]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-318">Example 318</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7514:1-7516:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7518:1-7520:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/bar*" title="ti*tle"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-319">Example 319</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7527:1-7531:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7533:1-7535:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/bar*" title="ti*tle"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-320">Example 320</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7542: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\+bar</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7548:1-7551:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code class="language-foo+bar"&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="7556:1-7556:42" dir="auto">
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7558:1-7560:30" dir="auto">Valid HTML entity references and numeric character references
2023-01-13 00:05:48 +05:30
can be used in place of the corresponding Unicode character,
with the following exceptions:</p>
2023-03-04 22:38:38 +05:30
<ul data-sourcepos="7562:1-7571:0" dir="auto">
<li data-sourcepos="7562:1-7564:0">
<p data-sourcepos="7562:3-7563:24">Entity and character references are not recognized in code
2023-01-13 00:05:48 +05:30
blocks and code spans.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="7565:1-7571:0">
<p data-sourcepos="7565:3-7570:9">Entity and character references cannot stand in place of
2023-01-13 00:05:48 +05:30
special characters that define structural elements in
CommonMark. For example, although <code>&amp;#42;</code> can be used
in place of a literal <code>*</code> character, <code>&amp;#42;</code> cannot replace
<code>*</code> in emphasis delimiters, bullet list markers, or thematic
breaks.</p>
</li>
</ul>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7572:1-7574:49" dir="auto">Conforming CommonMark parsers need not store information about
2023-01-13 00:05:48 +05:30
whether a particular character was represented in the source
using a Unicode character or an entity reference.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7576:1-7580:47" dir="auto"><a href="@">Entity references</a> consist of <code>&amp;</code> + any of the valid
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-321">Example 321</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7585:1-7589:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;nbsp; &amp;amp; &amp;copy; &amp;AElig; &amp;Dcaron;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&amp;frac34; &amp;HilbertSpace; &amp;DifferentialD;</span>
<span id="LC3" class="line" lang="plaintext">&amp;ClockwiseContourIntegral; &amp;ngE;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7591:1-7595:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;  &amp;amp; © Æ Ď</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">¾ </span>
<span id="LC3" class="line" lang="plaintext">∲ ≧̸&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7599:1-7605:58" dir="auto"><a href="@">Decimal numeric character
2023-01-13 00:05:48 +05:30
references</a>
consist of <code>&amp;#</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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-322">Example 322</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7610:1-7612:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;#35; &amp;#1234; &amp;#992; &amp;#0;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7614:1-7616:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;# Ӓ Ϡ <20>&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7620:1-7624:62" dir="auto"><a href="@">Hexadecimal numeric character
2023-01-13 00:05:48 +05:30
references</a> consist of <code>&amp;#</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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-323">Example 323</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7629:1-7631:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;#X22; &amp;#XD06; &amp;#xcab;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7633:1-7635:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;quot; ആ ಫ&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7639:1-7639:26" dir="auto">Here are some nonentities:</p>
<div>
<div><a href="#example-324">Example 324</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7644:1-7649:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;nbsp &amp;x; &amp;#; &amp;#x;</span>
2023-01-13 00:05:48 +05:30
<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?;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7651:1-7656:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;amp;nbsp &amp;amp;x; &amp;amp;#; &amp;amp;#x;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&amp;amp;#987654321;</span>
<span id="LC3" class="line" lang="plaintext">&amp;amp;#abcdef0;</span>
<span id="LC4" class="line" lang="plaintext">&amp;amp;ThisIsNotDefined; &amp;amp;hi?;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7660:1-7662:60" dir="auto">Although HTML5 does accept some entity references
2023-01-13 00:05:48 +05:30
without a trailing semicolon (such as <code>&amp;copy</code>), these are not
recognized here, because it makes the grammar too ambiguous:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-325">Example 325</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7667:1-7669:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;copy</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7671:1-7673:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;amp;copy&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7677:1-7678:39" dir="auto">Strings that are not on the list of HTML5 named entities are not
2023-01-13 00:05:48 +05:30
recognized as entity references either:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-326">Example 326</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7683:1-7685:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;MadeUpEntity;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7687:1-7689:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;amp;MadeUpEntity;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7693:1-7695:62" dir="auto">Entity and numeric character references are recognized in any
2023-01-13 00:05:48 +05:30
context besides code spans or code blocks, including
URLs, [link titles], and [fenced code block][] [info strings]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-327">Example 327</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7700:1-7702:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="&amp;ouml;&amp;ouml;.html"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7704:1-7706:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="&amp;ouml;&amp;ouml;.html"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-328">Example 328</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7713:1-7715:32" lang="plaintext" 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&amp;ouml;&amp;ouml; "f&amp;ouml;&amp;ouml;")</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7717:1-7719:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/f%C3%B6%C3%B6" title="föö"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-329">Example 329</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7726:1-7730:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">[foo]: /f&amp;ouml;&amp;ouml; "f&amp;ouml;&amp;ouml;"</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7732:1-7734:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/f%C3%B6%C3%B6" title="föö"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-330">Example 330</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7741:1-7745:32" lang="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&amp;ouml;&amp;ouml;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7747:1-7750:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code class="language-föö"&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7754:1-7755:35" dir="auto">Entity and numeric character references are treated as literal
2023-01-13 00:05:48 +05:30
text in code spans and code blocks:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-331">Example 331</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7760:1-7762:32" lang="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&amp;ouml;&amp;ouml;`</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7764:1-7766:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;f&amp;amp;ouml;&amp;amp;ouml;&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-332">Example 332</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7773:1-7775:32" lang="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&amp;ouml;f&amp;ouml;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7777:1-7780:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;&lt;code&gt;f&amp;amp;ouml;f&amp;amp;ouml;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;/code&gt;&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7784:1-7786:10" dir="auto">Entity and numeric character references cannot be used
2023-01-13 00:05:48 +05:30
in place of symbols indicating structure in CommonMark
documents.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-333">Example 333</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7791:1-7794:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;#42;foo&amp;#42;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7796:1-7799:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*foo*</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;em&gt;foo&lt;/em&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-334">Example 334</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7805:1-7809:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;#42; foo</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7811:1-7816:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;* foo&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;ul&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;li&gt;foo&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-335">Example 335</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7822:1-7824:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo&amp;#10;&amp;#10;bar</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7826:1-7830:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-336">Example 336</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7836:1-7838:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&amp;#9;foo</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7840:1-7842:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;→foo&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-337">Example 337</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7849:1-7851:32" lang="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 &amp;quot;tit&amp;quot;)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7853:1-7855:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[a](url &amp;quot;tit&amp;quot;)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="7859:1-7859:13" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-code-spans" class="anchor" href="#code-spans" aria-hidden="true"></a>Code spans</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7861:1-7863:36" dir="auto">A <a href="@">backtick string</a>
2023-01-13 00:05:48 +05:30
is a string of one or more backtick characters (<code>`</code>) that is neither
preceded nor followed by a backtick.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7865:1-7868:15" dir="auto">A <a href="@">code span</a> begins with a backtick string and ends with
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<ul data-sourcepos="7870:1-7877:0" dir="auto">
<li data-sourcepos="7870:1-7870:50">First, [line endings] are converted to [spaces].</li>
<li data-sourcepos="7871:1-7877:0">If the resulting string both begins <em>and</em> ends with a [space]
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="7878:1-7878:27" dir="auto">This is a simple code span:</p>
<div>
<div><a href="#example-338">Example 338</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7883:1-7885:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7887:1-7889:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;foo&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7893:1-7895:15" dir="auto">Here two backticks are used, because the code contains a backtick.
2023-01-13 00:05:48 +05:30
This example also illustrates stripping of a single leading and
trailing space:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-339">Example 339</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">&lt;p&gt;&lt;code&gt;foo ` bar&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7910:1-7911:7" dir="auto">This example shows the motivation for stripping leading and trailing
2023-01-13 00:05:48 +05:30
spaces:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-340">Example 340</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7916:1-7918:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7920:1-7922:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;``&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7925:1-7925:39" dir="auto">Note that only <em>one</em> space is stripped:</p>
<div>
<div><a href="#example-341">Example 341</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7930:1-7932:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7934:1-7936:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt; `` &lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7939:1-7940:20" dir="auto">The stripping only happens if the space is on both
2023-01-13 00:05:48 +05:30
sides of the string:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-342">Example 342</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7945:1-7947:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7949:1-7951:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt; a&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7954:1-7955:21" dir="auto">Only [spaces], and not [unicode whitespace] in general, are
2023-01-13 00:05:48 +05:30
stripped in this way:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-343">Example 343</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7960:1-7962:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7964:1-7966:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt; b &lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7969:1-7969:58" dir="auto">No stripping occurs if the code span contains only spaces:</p>
<div>
<div><a href="#example-344">Example 344</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7974:1-7977:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7979:1-7982:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt; &lt;/code&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;code&gt; &lt;/code&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="7986:1-7986:39" dir="auto">[Line endings] are treated like spaces:</p>
<div>
<div><a href="#example-345">Example 345</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7991:1-7997:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="7999:1-8001:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;foo bar baz&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-346">Example 346</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8007:1-8011:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8013:1-8015:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;foo &lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8019:1-8019:34" dir="auto">Interior spaces are not collapsed:</p>
<div>
<div><a href="#example-347">Example 347</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8024:1-8027:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8029:1-8031:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;foo bar baz&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8034:1-8036:26" dir="auto">Note that browsers will typically collapse consecutive spaces
2023-01-13 00:05:48 +05:30
when rendering <code>&lt;code&gt;</code> elements, so it is recommended that
the following CSS be used:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8038:5-8040: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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8041:1-8042:22" dir="auto">Note that backslash escapes do not work in code spans. All backslashes
2023-01-13 00:05:48 +05:30
are treated literally:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-348">Example 348</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8047:1-8049:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8051:1-8053:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;foo\&lt;/code&gt;bar`&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8057:1-8059:59" dir="auto">Backslash escapes are never needed, because one can always choose a
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-349">Example 349</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8064:1-8066:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8068:1-8070:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;foo`bar&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-350">Example 350</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8076:1-8078:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8080:1-8082:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;foo `` bar&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8086:1-8089:5" dir="auto">Code span backticks have higher precedence than any other inline
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-351">Example 351</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8094:1-8096:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8098:1-8100:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*foo&lt;code&gt;*&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8104:1-8104:33" dir="auto">And this is not parsed as a link:</p>
<div>
<div><a href="#example-352">Example 352</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8109:1-8111:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8113:1-8115:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[not a &lt;code&gt;link](/foo&lt;/code&gt;)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8119:1-8120:19" dir="auto">Code spans, HTML tags, and autolinks have the same precedence.
2023-01-13 00:05:48 +05:30
Thus, this is code:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-353">Example 353</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8125:1-8127:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`&lt;a href="`"&gt;`</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8129:1-8131:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;&amp;lt;a href=&amp;quot;&lt;/code&gt;&amp;quot;&amp;gt;`&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8135:1-8135:24" dir="auto">But this is an HTML tag:</p>
<div>
<div><a href="#example-354">Example 354</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8140:1-8142:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="`"&gt;`</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8144:1-8146:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="`"&gt;`&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8150:1-8150:17" dir="auto">And this is code:</p>
<div>
<div><a href="#example-355">Example 355</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8155:1-8157:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`&lt;http://foo.bar.`baz&gt;`</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8159:1-8161:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;&amp;lt;http://foo.bar.&lt;/code&gt;baz&amp;gt;`&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8165:1-8165:24" dir="auto">But this is an autolink:</p>
<div>
<div><a href="#example-356">Example 356</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8170:1-8172:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;http://foo.bar.`baz&gt;`</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8174:1-8176:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://foo.bar.%60baz"&gt;http://foo.bar.`baz&lt;/a&gt;`&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8180:1-8181:31" dir="auto">When a backtick string is not closed by a matching backtick string,
2023-01-13 00:05:48 +05:30
we just have literal backticks:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-357">Example 357</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8186:1-8188:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8190:1-8192:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;```foo``&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-358">Example 358</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8199:1-8201:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8203:1-8205:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;`foo&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8208:1-8209:47" dir="auto">The following case also illustrates the need for opening and
2023-01-13 00:05:48 +05:30
closing backtick strings to be equal in length:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-359">Example 359</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8214:1-8216:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8218:1-8220:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;`foo&lt;code&gt;bar&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="8224:1-8224:31" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-emphasis-and-strong-emphasis" class="anchor" href="#emphasis-and-strong-emphasis" aria-hidden="true"></a>Emphasis and strong emphasis</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8226:1-8227:73" dir="auto">John Gruber's original <a href="http://daringfireball.net/projects/markdown/syntax#em" rel="nofollow noreferrer noopener" target="_blank">Markdown syntax
2023-01-13 00:05:48 +05:30
description</a> says:</p>
2023-03-04 22:38:38 +05:30
<blockquote data-sourcepos="8229:1-8232:6" dir="auto">
<p data-sourcepos="8229:3-8232:6">Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of
2023-01-13 00:05:48 +05:30
emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an HTML
<code>&lt;em&gt;</code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML <code>&lt;strong&gt;</code>
tag.</p>
</blockquote>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8234:1-8238:57" dir="auto">This is enough for most users, but these rules leave much undecided,
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8240:1-8246: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8248:1-8250:9" dir="auto">The following patterns are less widely supported, but the intent
2023-01-13 00:05:48 +05:30
is clear and they are useful (especially in contexts like bibliography
entries):</p>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8252:1-8255: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8257:1-8260:31" dir="auto">Many implementations have also restricted intraword emphasis to
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8262:1-8265: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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="markdown">no emphasis: foo_bar_baz</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8267:1-8268:55" dir="auto">The rules given below capture all of these patterns, while allowing
2023-01-13 00:05:48 +05:30
for efficient parsing strategies that do not backtrack.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8270:1-8274:38" dir="auto">First, some definitions. A <a href="@">delimiter run</a> is either
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8276:1-8282:37" dir="auto">A <a href="@">left-flanking delimiter run</a> is
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8284:1-8290:37" dir="auto">A <a href="@">right-flanking delimiter run</a> is
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8292:1-8292:41" dir="auto">Here are some examples of delimiter runs.</p>
<ul data-sourcepos="8294:3-8325:0" dir="auto">
<li data-sourcepos="8294:3-8302:0">
<p data-sourcepos="8294:5-8294:41">left-flanking but not right-flanking:</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8296:5-8301: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8303:3-8311:0">
<p data-sourcepos="8303:5-8303:41">right-flanking but not left-flanking:</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8305:5-8310: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>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8312:3-8318:0">
<p data-sourcepos="8312:5-8312:33">Both left and right-flanking:</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8314:5-8317: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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">"abc"_"def"</span></code></pre>
<copy-code></copy-code>
</div>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8319:3-8325:0">
<p data-sourcepos="8319:5-8319:36">Neither left nor right-flanking:</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8321:5-8324: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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">a _ b</span></code></pre>
<copy-code></copy-code>
</div>
</li>
</ul>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8326:1-8332:49" dir="auto">(The idea of distinguishing left-flanking and right-flanking
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8334:1-8334:56" dir="auto">The following rules define emphasis and strong emphasis:</p>
<ol data-sourcepos="8336:1-8400:0" dir="auto">
<li data-sourcepos="8336:1-8338:0">
<p data-sourcepos="8336:5-8337:71">A single <code>*</code> character <a href="@">can open emphasis</a>
2023-01-13 00:05:48 +05:30
iff (if and only if) it is part of a [left-flanking delimiter run].</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8339:1-8344:0">
<p data-sourcepos="8339:5-8343:28">A single <code>_</code> character [can open emphasis] iff
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8345:1-8347:0">
<p data-sourcepos="8345:5-8346:55">A single <code>*</code> character <a href="@">can close emphasis</a>
2023-01-13 00:05:48 +05:30
iff it is part of a [right-flanking delimiter run].</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8348:1-8353:0">
<p data-sourcepos="8348:5-8352:28">A single <code>_</code> character [can close emphasis] iff
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8354:1-8356:0">
<p data-sourcepos="8354:5-8355:54">A double <code>**</code> <a href="@">can open strong emphasis</a>
2023-01-13 00:05:48 +05:30
iff it is part of a [left-flanking delimiter run].</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8357:1-8362:0">
<p data-sourcepos="8357:5-8361:28">A double <code>__</code> [can open strong emphasis] iff
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8363:1-8365:0">
<p data-sourcepos="8363:5-8364:55">A double <code>**</code> <a href="@">can close strong emphasis</a>
2023-01-13 00:05:48 +05:30
iff it is part of a [right-flanking delimiter run].</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8366:1-8371:0">
<p data-sourcepos="8366:5-8370:28">A double <code>__</code> [can close strong emphasis] iff
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8372:1-8381:0">
<p data-sourcepos="8372:5-8380:19">Emphasis begins with a delimiter that [can open emphasis] and ends
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8382:1-8392:0">
<p data-sourcepos="8382:5-8391:23">Strong emphasis begins with a delimiter that
2023-01-13 00:05:48 +05:30
[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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8393:1-8396:0">
<p data-sourcepos="8393:5-8395:25">A literal <code>*</code> character cannot occur at the beginning or end of
2023-01-13 00:05:48 +05:30
<code>*</code>-delimited emphasis or <code>**</code>-delimited strong emphasis, unless it
is backslash-escaped.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8397:1-8400:0">
<p data-sourcepos="8397:5-8399:25">A literal <code>_</code> character cannot occur at the beginning or end of
2023-01-13 00:05:48 +05:30
<code>_</code>-delimited emphasis or <code>__</code>-delimited strong emphasis, unless it
is backslash-escaped.</p>
</li>
</ol>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8401:1-8402:43" dir="auto">Where rules 1--12 above are compatible with multiple parsings,
2023-01-13 00:05:48 +05:30
the following principles resolve ambiguity:</p>
2023-03-04 22:38:38 +05:30
<ol start="13" data-sourcepos="8404:1-8429:0" dir="auto">
<li data-sourcepos="8404:1-8407:0">
<p data-sourcepos="8404:5-8406:28">The number of nestings should be minimized. Thus, for example,
2023-01-13 00:05:48 +05:30
an interpretation <code>&lt;strong&gt;...&lt;/strong&gt;</code> is always preferred to
<code>&lt;em&gt;&lt;em&gt;...&lt;/em&gt;&lt;/em&gt;</code>.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8408:1-8410:0">
<p data-sourcepos="8408:5-8409:49">An interpretation <code>&lt;em&gt;&lt;strong&gt;...&lt;/strong&gt;&lt;/em&gt;</code> is always
2023-01-13 00:05:48 +05:30
preferred to <code>&lt;strong&gt;&lt;em&gt;...&lt;/em&gt;&lt;/strong&gt;</code>.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8411:1-8416:0">
<p data-sourcepos="8411:5-8415:34">When two potential emphasis or strong emphasis spans overlap,
2023-01-13 00:05:48 +05:30
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>&lt;em&gt;foo _bar&lt;/em&gt; baz_</code> rather
than <code>*foo &lt;em&gt;bar* baz&lt;/em&gt;</code>.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8417:1-8422:0">
<p data-sourcepos="8417:5-8421:49">When there are two potential emphasis or strong emphasis spans
2023-01-13 00:05:48 +05:30
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 &lt;strong&gt;bar baz&lt;/strong&gt;</code>
rather than <code>&lt;strong&gt;foo **bar baz&lt;/strong&gt;</code>.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="8423:1-8429:0">
<p data-sourcepos="8423:5-8428:26">Inline code spans, links, images, and HTML tags group more tightly
2023-01-13 00:05:48 +05:30
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>*&lt;a href="bar"&gt;foo*&lt;/a&gt;</code> rather than as
<code>&lt;em&gt;[foo&lt;/em&gt;](bar)</code>.</p>
</li>
</ol>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="8430:1-8430:60" dir="auto">These rules can be illustrated through a series of examples.</p>
<p data-sourcepos="8432:1-8432:7" dir="auto">Rule 1:</p>
<div>
<div><a href="#example-360">Example 360</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8437:1-8439:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8441:1-8443:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8447:1-8448:66" dir="auto">This is not emphasis, because the opening <code>*</code> is followed by
2023-01-13 00:05:48 +05:30
whitespace, and hence not part of a [left-flanking delimiter run]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-361">Example 361</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8453:1-8455:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8457:1-8459:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;a * foo bar*&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8463:1-8465:44" dir="auto">This is not emphasis, because the opening <code>*</code> is preceded
2023-01-13 00:05:48 +05:30
by an alphanumeric and followed by punctuation, and hence
not part of a [left-flanking delimiter run]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-362">Example 362</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8470:1-8472:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8474:1-8476:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;a*&amp;quot;foo&amp;quot;*&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8480:1-8480:52" dir="auto">Unicode nonbreaking spaces count as whitespace, too:</p>
<div>
<div><a href="#example-363">Example 363</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8485:1-8487:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8489:1-8491:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;* a *&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8495:1-8495:41" dir="auto">Intraword emphasis with <code>*</code> is permitted:</p>
<div>
<div><a href="#example-364">Example 364</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8500:1-8502:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8504:1-8506:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;em&gt;bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-365">Example 365</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8513:1-8515:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8517:1-8519:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;5&lt;em&gt;6&lt;/em&gt;78&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8523:1-8523:7" dir="auto">Rule 2:</p>
<div>
<div><a href="#example-366">Example 366</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8528:1-8530:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8532:1-8534:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8538:1-8539:11" dir="auto">This is not emphasis, because the opening <code>_</code> is followed by
2023-01-13 00:05:48 +05:30
whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-367">Example 367</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8544:1-8546:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8548:1-8550:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_ foo bar_&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8554:1-8555:47" dir="auto">This is not emphasis, because the opening <code>_</code> is preceded
2023-01-13 00:05:48 +05:30
by an alphanumeric and followed by punctuation:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-368">Example 368</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8560:1-8562:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8564:1-8566:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;a_&amp;quot;foo&amp;quot;_&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8570:1-8570:46" dir="auto">Emphasis with <code>_</code> is not allowed inside words:</p>
<div>
<div><a href="#example-369">Example 369</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8575:1-8577:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8579:1-8581:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo_bar_&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-370">Example 370</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8588:1-8590:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8592:1-8594:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;5_6_78&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-371">Example 371</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8601:1-8603:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8605:1-8607:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;пристаням_стремятся_&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8611:1-8612:47" dir="auto">Here <code>_</code> does not generate emphasis, because the first delimiter run
2023-01-13 00:05:48 +05:30
is right-flanking and the second left-flanking:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-372">Example 372</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8617:1-8619:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8621:1-8623:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;aa_&amp;quot;bb&amp;quot;_cc&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8627:1-8629:12" dir="auto">This is emphasis, even though the opening delimiter is
2023-01-13 00:05:48 +05:30
both left- and right-flanking, because it is preceded by
punctuation:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-373">Example 373</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8634:1-8636:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8638:1-8640:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo-&lt;em&gt;(bar)&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8644:1-8644:7" dir="auto">Rule 3:</p>
<p data-sourcepos="8646:1-8647:32" dir="auto">This is not emphasis, because the closing delimiter does
2023-01-13 00:05:48 +05:30
not match the opening delimiter:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-374">Example 374</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8652:1-8654:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8656:1-8658:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_foo*&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8662:1-8663:11" dir="auto">This is not emphasis, because the closing <code>*</code> is preceded by
2023-01-13 00:05:48 +05:30
whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-375">Example 375</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8668:1-8670:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8672:1-8674:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*foo bar *&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8678:1-8678:36" dir="auto">A newline also counts as whitespace:</p>
<div>
<div><a href="#example-376">Example 376</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8683:1-8686:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8688:1-8691:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*foo bar</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">*&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8695:1-8697:58" dir="auto">This is not emphasis, because the second <code>*</code> is
2023-01-13 00:05:48 +05:30
preceded by punctuation and followed by an alphanumeric
(hence it is not part of a [right-flanking delimiter run]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-377">Example 377</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8702:1-8704:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8706:1-8708:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*(*foo)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8712:1-8713:18" dir="auto">The point of this restriction is more easily appreciated
2023-01-13 00:05:48 +05:30
with this example:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-378">Example 378</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8718:1-8720:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8722:1-8724:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;(&lt;em&gt;foo&lt;/em&gt;)&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8728:1-8728:39" dir="auto">Intraword emphasis with <code>*</code> is allowed:</p>
<div>
<div><a href="#example-379">Example 379</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8733:1-8735:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8737:1-8739:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;/em&gt;bar&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8744:1-8744:7" dir="auto">Rule 4:</p>
<p data-sourcepos="8746:1-8747:11" dir="auto">This is not emphasis, because the closing <code>_</code> is preceded by
2023-01-13 00:05:48 +05:30
whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-380">Example 380</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8752:1-8754:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8756:1-8758:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_foo bar _&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8762:1-8763:56" dir="auto">This is not emphasis, because the second <code>_</code> is
2023-01-13 00:05:48 +05:30
preceded by punctuation and followed by an alphanumeric:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-381">Example 381</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8768:1-8770:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8772:1-8774:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_(_foo)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8778:1-8778:33" dir="auto">This is emphasis within emphasis:</p>
<div>
<div><a href="#example-382">Example 382</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8783:1-8785:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8787:1-8789:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;(&lt;em&gt;foo&lt;/em&gt;)&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8793:1-8793:41" dir="auto">Intraword emphasis is disallowed for <code>_</code>:</p>
<div>
<div><a href="#example-383">Example 383</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8798:1-8800:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8802:1-8804:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_foo_bar&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-384">Example 384</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8811:1-8813:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8815:1-8817:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_пристаням_стремятся&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-385">Example 385</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8824:1-8826:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8828:1-8830:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo_bar_baz&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8834:1-8836:12" dir="auto">This is emphasis, even though the closing delimiter is
2023-01-13 00:05:48 +05:30
both left- and right-flanking, because it is followed by
punctuation:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-386">Example 386</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8841:1-8843:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8845:1-8847:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;(bar)&lt;/em&gt;.&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8851:1-8851:7" dir="auto">Rule 5:</p>
<div>
<div><a href="#example-387">Example 387</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8856:1-8858:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8860:1-8862:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo bar&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8866:1-8867:23" dir="auto">This is not strong emphasis, because the opening delimiter is
2023-01-13 00:05:48 +05:30
followed by whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-388">Example 388</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8872:1-8874:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8876:1-8878:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;** foo bar**&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8882:1-8884:44" dir="auto">This is not strong emphasis, because the opening <code>**</code> is preceded
2023-01-13 00:05:48 +05:30
by an alphanumeric and followed by punctuation, and hence
not part of a [left-flanking delimiter run]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-389">Example 389</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8889:1-8891:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8893:1-8895:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;a**&amp;quot;foo&amp;quot;**&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8899:1-8899:49" dir="auto">Intraword strong emphasis with <code>**</code> is permitted:</p>
<div>
<div><a href="#example-390">Example 390</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8904:1-8906:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8908:1-8910:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;strong&gt;bar&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8914:1-8914:7" dir="auto">Rule 6:</p>
<div>
<div><a href="#example-391">Example 391</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8919:1-8921:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8923:1-8925:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo bar&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8929:1-8930:23" dir="auto">This is not strong emphasis, because the opening delimiter is
2023-01-13 00:05:48 +05:30
followed by whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-392">Example 392</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8935:1-8937:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8939:1-8941:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;__ foo bar__&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8945:1-8945:31" dir="auto">A newline counts as whitespace:</p>
<div>
<div><a href="#example-393">Example 393</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8949:1-8952:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8954:1-8957:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;__</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">foo bar__&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8961:1-8962:47" dir="auto">This is not strong emphasis, because the opening <code>__</code> is preceded
2023-01-13 00:05:48 +05:30
by an alphanumeric and followed by punctuation:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-394">Example 394</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8967:1-8969:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8971:1-8973:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;a__&amp;quot;foo&amp;quot;__&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="8977:1-8977:49" dir="auto">Intraword strong emphasis is forbidden with <code>__</code>:</p>
<div>
<div><a href="#example-395">Example 395</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8982:1-8984:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8986:1-8988:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo__bar__&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-396">Example 396</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8995:1-8997:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="8999:1-9001:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;5__6__78&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-397">Example 397</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9008:1-9010:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9012:1-9014:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;пристаням__стремятся__&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-398">Example 398</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9021:1-9023:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9025:1-9027:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo, &lt;strong&gt;bar&lt;/strong&gt;, baz&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9031:1-9033:12" dir="auto">This is strong emphasis, even though the opening delimiter is
2023-01-13 00:05:48 +05:30
both left- and right-flanking, because it is preceded by
punctuation:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-399">Example 399</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9038:1-9040:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9042:1-9044:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo-&lt;strong&gt;(bar)&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9049:1-9049:7" dir="auto">Rule 7:</p>
<p data-sourcepos="9051:1-9052:14" dir="auto">This is not strong emphasis, because the closing delimiter is preceded
2023-01-13 00:05:48 +05:30
by whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-400">Example 400</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9057:1-9059:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9061:1-9063:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;**foo bar **&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9067:1-9068:9" dir="auto">(Nor can it be interpreted as an emphasized <code>*foo bar *</code>, because of
2023-01-13 00:05:48 +05:30
Rule 11.)</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="9070:1-9071:56" dir="auto">This is not strong emphasis, because the second <code>**</code> is
2023-01-13 00:05:48 +05:30
preceded by punctuation and followed by an alphanumeric:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-401">Example 401</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9076:1-9078:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9080:1-9082:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;**(**foo)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9086:1-9087:20" dir="auto">The point of this restriction is more easily appreciated
2023-01-13 00:05:48 +05:30
with these examples:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-402">Example 402</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9092:1-9094:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9096:1-9098:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;(&lt;strong&gt;foo&lt;/strong&gt;)&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-403">Example 403</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9105:1-9108:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9110:1-9113:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;Gomphocarpus (&lt;em&gt;Gomphocarpus physocarpus&lt;/em&gt;, syn.</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;em&gt;Asclepias physocarpa&lt;/em&gt;)&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-404">Example 404</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9120:1-9122:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9124:1-9126:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &amp;quot;&lt;em&gt;bar&lt;/em&gt;&amp;quot; foo&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9130:1-9130:19" dir="auto">Intraword emphasis:</p>
<div>
<div><a href="#example-405">Example 405</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9135:1-9137:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9139:1-9141:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo&lt;/strong&gt;bar&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9145:1-9145:7" dir="auto">Rule 8:</p>
<p data-sourcepos="9147:1-9148:23" dir="auto">This is not strong emphasis, because the closing delimiter is
2023-01-13 00:05:48 +05:30
preceded by whitespace:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-406">Example 406</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9153:1-9155:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9157:1-9159:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;__foo bar __&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9163:1-9164:56" dir="auto">This is not strong emphasis, because the second <code>__</code> is
2023-01-13 00:05:48 +05:30
preceded by punctuation and followed by an alphanumeric:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-407">Example 407</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9169:1-9171:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9173:1-9175:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;__(__foo)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9179:1-9180:18" dir="auto">The point of this restriction is more easily appreciated
2023-01-13 00:05:48 +05:30
with this example:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-408">Example 408</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9185:1-9187:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9189:1-9191:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;(&lt;strong&gt;foo&lt;/strong&gt;)&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9195:1-9195:49" dir="auto">Intraword strong emphasis is forbidden with <code>__</code>:</p>
<div>
<div><a href="#example-409">Example 409</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9200:1-9202:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9204:1-9206:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;__foo__bar&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-410">Example 410</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9213:1-9215:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9217:1-9219:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;__пристаням__стремятся&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-411">Example 411</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9226:1-9228:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9230:1-9232:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo__bar__baz&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9236:1-9238:12" dir="auto">This is strong emphasis, even though the closing delimiter is
2023-01-13 00:05:48 +05:30
both left- and right-flanking, because it is followed by
punctuation:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-412">Example 412</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9243:1-9245:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9247:1-9249:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;(bar)&lt;/strong&gt;.&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9253:1-9253:7" dir="auto">Rule 9:</p>
<p data-sourcepos="9255:1-9256:16" dir="auto">Any nonempty sequence of inline elements can be the contents of an
2023-01-13 00:05:48 +05:30
emphasized span.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-413">Example 413</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9261:1-9263:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9265:1-9267:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;a href="/url"&gt;bar&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-414">Example 414</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9274:1-9277:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9279:1-9282:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9286:1-9287:16" dir="auto">In particular, emphasis and strong emphasis can be nested
2023-01-13 00:05:48 +05:30
inside emphasis:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-415">Example 415</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9292:1-9294:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9296:1-9298:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;strong&gt;bar&lt;/strong&gt; baz&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-416">Example 416</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9305:1-9307:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9309:1-9311:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;em&gt;bar&lt;/em&gt; baz&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-417">Example 417</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9318:1-9320:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9322:1-9324:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;&lt;em&gt;foo&lt;/em&gt; bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-418">Example 418</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9331:1-9333:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9335:1-9337:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;em&gt;bar&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-419">Example 419</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9344:1-9346:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9348:1-9350:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;strong&gt;bar&lt;/strong&gt; baz&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-420">Example 420</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9356:1-9358:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9360:1-9362:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;strong&gt;bar&lt;/strong&gt;baz&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9365:1-9365:51" dir="auto">Note that in the preceding case, the interpretation</p>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9367:1-9369: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">&lt;p&gt;&lt;em&gt;</span>foo<span class="nt">&lt;/em&gt;&lt;em&gt;</span>bar<span class="nt">&lt;em&gt;&lt;/em&gt;</span>baz<span class="nt">&lt;/em&gt;&lt;/p&gt;</span></span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="9372:1-9377:32" dir="auto">is precluded by the condition that a delimiter that
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="9380:1-9381:34" dir="auto">For the same reason, we don't get two consecutive
2023-01-13 00:05:48 +05:30
emphasis sections in this example:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-421">Example 421</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9386:1-9388:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9390:1-9392:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo**bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9396:1-9399:8" dir="auto">The same condition ensures that the following
2023-01-13 00:05:48 +05:30
cases are all strong emphasis nested inside
emphasis, even when the interior spaces are
omitted:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-422">Example 422</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9405:1-9407:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9409:1-9411:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;&lt;strong&gt;foo&lt;/strong&gt; bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-423">Example 423</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9418:1-9420:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9422:1-9424:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;strong&gt;bar&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-424">Example 424</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9431:1-9433:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9435:1-9437:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;strong&gt;bar&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9441:1-9443:34" dir="auto">When the lengths of the interior closing and opening
2023-01-13 00:05:48 +05:30
delimiter runs are <em>both</em> multiples of 3, though,
they can match to create emphasis:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-425">Example 425</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9448:1-9450:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9452:1-9454:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;em&gt;&lt;strong&gt;bar&lt;/strong&gt;&lt;/em&gt;baz&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-426">Example 426</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9460: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******bar*********baz</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">&lt;p&gt;foo&lt;strong&gt;&lt;strong&gt;&lt;strong&gt;bar&lt;/strong&gt;&lt;/strong&gt;&lt;/strong&gt;***baz&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9470:1-9470:42" dir="auto">Indefinite levels of nesting are possible:</p>
<div>
<div><a href="#example-427">Example 427</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9475:1-9477:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9479:1-9481:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;strong&gt;bar &lt;em&gt;baz&lt;/em&gt; bim&lt;/strong&gt; bop&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-428">Example 428</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9488:1-9490:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9492:1-9494:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;a href="/url"&gt;&lt;em&gt;bar&lt;/em&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9498:1-9498:50" dir="auto">There can be no empty emphasis or strong emphasis:</p>
<div>
<div><a href="#example-429">Example 429</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9503:1-9505:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9507:1-9509:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;** is not an empty emphasis&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-430">Example 430</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9516:1-9518:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9520:1-9522:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;**** is not an empty strong emphasis&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9527:1-9527:8" dir="auto">Rule 10:</p>
<p data-sourcepos="9529:1-9530:25" dir="auto">Any nonempty sequence of inline elements can be the contents of an
2023-01-13 00:05:48 +05:30
strongly emphasized span.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-431">Example 431</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9535:1-9537:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9539:1-9541:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &lt;a href="/url"&gt;bar&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-432">Example 432</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9548:1-9551:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9553:1-9556:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9560:1-9561:23" dir="auto">In particular, emphasis and strong emphasis can be nested
2023-01-13 00:05:48 +05:30
inside strong emphasis:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-433">Example 433</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9566:1-9568:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9570:1-9572:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &lt;em&gt;bar&lt;/em&gt; baz&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-434">Example 434</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9579:1-9581:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9583:1-9585:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &lt;strong&gt;bar&lt;/strong&gt; baz&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-435">Example 435</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9592:1-9594:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9596:1-9598:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;&lt;strong&gt;foo&lt;/strong&gt; bar&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-436">Example 436</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9605:1-9607:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9609:1-9611:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &lt;strong&gt;bar&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-437">Example 437</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9618:1-9620:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9622:1-9624:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &lt;em&gt;bar&lt;/em&gt; baz&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-438">Example 438</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9631:1-9633:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9635:1-9637:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo&lt;em&gt;bar&lt;/em&gt;baz&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-439">Example 439</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9644:1-9646:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9648:1-9650:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;&lt;em&gt;foo&lt;/em&gt; bar&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-440">Example 440</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9657:1-9659:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9661:1-9663:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &lt;em&gt;bar&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9667:1-9667:42" dir="auto">Indefinite levels of nesting are possible:</p>
<div>
<div><a href="#example-441">Example 441</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9672:1-9675:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9677:1-9680:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &lt;em&gt;bar &lt;strong&gt;baz&lt;/strong&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bim&lt;/em&gt; bop&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-442">Example 442</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9687:1-9689:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9691:1-9693:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo &lt;a href="/url"&gt;&lt;em&gt;bar&lt;/em&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9697:1-9697:50" dir="auto">There can be no empty emphasis or strong emphasis:</p>
<div>
<div><a href="#example-443">Example 443</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9702:1-9704:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9706:1-9708:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;__ is not an empty emphasis&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-444">Example 444</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9715:1-9717:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9719:1-9721:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;____ is not an empty strong emphasis&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9726:1-9726:8" dir="auto">Rule 11:</p>
<div>
<div><a href="#example-445">Example 445</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9731:1-9733:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9735:1-9737:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo ***&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-446">Example 446</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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 *\**</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">&lt;p&gt;foo &lt;em&gt;*&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-447">Example 447</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9757:1-9759:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9761:1-9763:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;em&gt;_&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-448">Example 448</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9770:1-9772:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9774:1-9776:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo *****&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-449">Example 449</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9783:1-9785:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9787:1-9789:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;strong&gt;*&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-450">Example 450</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9796:1-9798:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9800:1-9802:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;strong&gt;_&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9806:1-9808:32" dir="auto">Note that when delimiters do not match evenly, Rule 11 determines
2023-01-13 00:05:48 +05:30
that the excess literal <code>*</code> characters will appear outside of the
emphasis, rather than inside it:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-451">Example 451</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9813:1-9815:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9817:1-9819:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*&lt;em&gt;foo&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-452">Example 452</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9826:1-9828:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9830:1-9832:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;/em&gt;*&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-453">Example 453</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9839:1-9841:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9843:1-9845:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*&lt;strong&gt;foo&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-454">Example 454</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9852:1-9854:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9856:1-9858:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;***&lt;em&gt;foo&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-455">Example 455</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9865:1-9867:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9869:1-9871:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo&lt;/strong&gt;*&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-456">Example 456</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9878:1-9880:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9882:1-9884:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;/em&gt;***&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9889:1-9889:8" dir="auto">Rule 12:</p>
<div>
<div><a href="#example-457">Example 457</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9894:1-9896:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9898:1-9900:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo ___&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-458">Example 458</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9907:1-9909:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9911:1-9913:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;em&gt;_&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-459">Example 459</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9920:1-9922:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9924:1-9926:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;em&gt;*&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-460">Example 460</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9933:1-9935:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9937:1-9939:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo _____&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-461">Example 461</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9946:1-9948:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9950:1-9952:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;strong&gt;_&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-462">Example 462</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9959:1-9961:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9963:1-9965:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;strong&gt;*&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-463">Example 463</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9972:1-9974:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9976:1-9978:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_&lt;em&gt;foo&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="9982:1-9984:32" dir="auto">Note that when delimiters do not match evenly, Rule 12 determines
2023-01-13 00:05:48 +05:30
that the excess literal <code>_</code> characters will appear outside of the
emphasis, rather than inside it:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-464">Example 464</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9989:1-9991:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="9993:1-9995:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;/em&gt;_&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-465">Example 465</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10002:1-10004:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10006:1-10008:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_&lt;strong&gt;foo&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-466">Example 466</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10015:1-10017:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10019:1-10021:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;___&lt;em&gt;foo&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-467">Example 467</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10028:1-10030:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10032:1-10034:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo&lt;/strong&gt;_&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-468">Example 468</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10041:1-10043:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10045:1-10047:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;/em&gt;___&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10051:1-10052:44" dir="auto">Rule 13 implies that if you want emphasis nested directly inside
2023-01-13 00:05:48 +05:30
emphasis, you must use different delimiters:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-469">Example 469</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10057:1-10059:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10061:1-10063:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-470">Example 470</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10070:1-10072:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10074:1-10076:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;&lt;em&gt;foo&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-471">Example 471</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10083:1-10085:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10087:1-10089:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;foo&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-472">Example 472</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10096:1-10098:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10100:1-10102:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;&lt;em&gt;foo&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10106:1-10107:21" dir="auto">However, strong emphasis within strong emphasis is possible without
2023-01-13 00:05:48 +05:30
switching delimiters:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-473">Example 473</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10112:1-10114:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10116:1-10118:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;&lt;strong&gt;foo&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-474">Example 474</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">____foo____</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">&lt;p&gt;&lt;strong&gt;&lt;strong&gt;foo&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10136:1-10137:11" dir="auto">Rule 13 can be applied to arbitrarily long sequences of
2023-01-13 00:05:48 +05:30
delimiters:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-475">Example 475</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10142:1-10144:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10146:1-10148:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt;&lt;strong&gt;&lt;strong&gt;foo&lt;/strong&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10152:1-10152:8" dir="auto">Rule 14:</p>
<div>
<div><a href="#example-476">Example 476</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10157:1-10159:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10161:1-10163:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;&lt;strong&gt;foo&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-477">Example 477</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10170:1-10172:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10174:1-10176:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;strong&gt;foo&lt;/strong&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10180:1-10180:8" dir="auto">Rule 15:</p>
<div>
<div><a href="#example-478">Example 478</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10185:1-10187:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10189:1-10191:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo _bar&lt;/em&gt; baz_&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-479">Example 479</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10198:1-10200:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10202:1-10204:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo &lt;strong&gt;bar *baz bim&lt;/strong&gt; bam&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10208:1-10208:8" dir="auto">Rule 16:</p>
<div>
<div><a href="#example-480">Example 480</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10213:1-10215:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10217:1-10219:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;**foo &lt;strong&gt;bar baz&lt;/strong&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-481">Example 481</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">*foo *bar baz*</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">&lt;p&gt;*foo &lt;em&gt;bar baz&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10236:1-10236:8" dir="auto">Rule 17:</p>
<div>
<div><a href="#example-482">Example 482</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10241: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">*[bar*](/url)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10245:1-10247:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*&lt;a href="/url"&gt;bar*&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-483">Example 483</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10254:1-10256:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10258:1-10260:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;_foo &lt;a href="/url"&gt;bar_&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-484">Example 484</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10267:1-10269:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*&lt;img src="foo" title="*"/&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10271:1-10273:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*&lt;img src="foo" title="*"/&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-485">Example 485</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10280:1-10282:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**&lt;a href="**"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10284:1-10286:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;**&lt;a href="**"&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-486">Example 486</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">__&lt;a href="__"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">&lt;p&gt;__&lt;a href="__"&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-487">Example 487</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10306:1-10308:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10310:1-10312:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;a &lt;code&gt;*&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-488">Example 488</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10319:1-10321:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10323:1-10325:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;a &lt;code&gt;_&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-489">Example 489</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10332:1-10334:32" lang="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&lt;http://foo.bar/?q=**&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10336:1-10338:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;**a&lt;a href="http://foo.bar/?q=**"&gt;http://foo.bar/?q=**&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-490">Example 490</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10345:1-10347:32" lang="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&lt;http://foo.bar/?q=__&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10349:1-10351:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;__a&lt;a href="http://foo.bar/?q=__"&gt;http://foo.bar/?q=__&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
2023-01-13 00:05:48 +05:30
<div>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="10357:1-10357:28">
2023-01-13 00:05:48 +05:30
<a id="user-content-strikethrough-extension" class="anchor" href="#strikethrough-extension" aria-hidden="true"></a>Strikethrough (extension)</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10359:1-10360:10">GFM enables the <code>strikethrough</code> extension, where an additional emphasis type is
2023-01-13 00:05:48 +05:30
available.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10362:1-10362:59">Strikethrough text is any text wrapped in two tildes (<code>~</code>).</p>
<div>
<div><a href="#example-491">Example 491</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10367:1-10369:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10371:1-10373:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;del&gt;Hi&lt;/del&gt; Hello, world!&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10376:1-10377:17">As with regular emphasis delimiters, a new paragraph will cause strikethrough
2023-01-13 00:05:48 +05:30
parsing to cease:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-492">Example 492</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10382:1-10386:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10388:1-10391:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;This ~~has a&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;new paragraph~~.&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="10396:1-10396:8" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-links" class="anchor" href="#links" aria-hidden="true"></a>Links</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10398:1-10403:13" dir="auto">A link contains [link text] (the visible text), a [link destination]
2023-01-13 00:05:48 +05:30
(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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10405:1-10407:22" dir="auto">A <a href="@">link text</a> consists of a sequence of zero or more
2023-01-13 00:05:48 +05:30
inline elements enclosed by square brackets (<code>[</code> and <code>]</code>). The
following rules apply:</p>
2023-03-04 22:38:38 +05:30
<ul data-sourcepos="10409:1-10425:0" dir="auto">
<li data-sourcepos="10409:1-10412:0">
<p data-sourcepos="10409:3-10411:43">Links may not contain other links, at any level of nesting. If
2023-01-13 00:05:48 +05:30
multiple otherwise valid link definitions appear nested inside each
other, the inner-most definition is used.</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="10413:1-10417:0">
<p data-sourcepos="10413:3-10416:22">Brackets are allowed in the [link text] only if (a) they
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="10418:1-10422:0">
<p data-sourcepos="10418:3-10421:25">Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="10423:1-10425:0">
<p data-sourcepos="10423:3-10424:78">The brackets in link text bind more tightly than markers for
2023-01-13 00:05:48 +05:30
[emphasis and strong emphasis]. Thus, for example, <code>*[foo*](url)</code> is a link.</p>
</li>
</ul>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10426:1-10426:42" dir="auto">A <a href="@">link destination</a> consists of either</p>
<ul data-sourcepos="10428:1-10439:0" dir="auto">
<li data-sourcepos="10428:1-10431:0">
<p data-sourcepos="10428:3-10430:27">a sequence of zero or more characters between an opening <code>&lt;</code> and a
2023-01-13 00:05:48 +05:30
closing <code>&gt;</code> that contains no line breaks or unescaped
<code>&lt;</code> or <code>&gt;</code> characters, or</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="10432:1-10439:0">
<p data-sourcepos="10432:3-10438:23">a nonempty sequence of characters that does not start with
2023-01-13 00:05:48 +05:30
<code>&lt;</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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10440:1-10440:37" dir="auto">A <a href="@">link title</a> consists of either</p>
<ul data-sourcepos="10442:1-10453:0" dir="auto">
<li data-sourcepos="10442:1-10445:0">
<p data-sourcepos="10442:3-10444:23">a sequence of zero or more characters between straight double-quote
2023-01-13 00:05:48 +05:30
characters (<code>"</code>), including a <code>"</code> character only if it is
backslash-escaped, or</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="10446:1-10449:0">
<p data-sourcepos="10446:3-10448:23">a sequence of zero or more characters between straight single-quote
2023-01-13 00:05:48 +05:30
characters (<code>'</code>), including a <code>'</code> character only if it is
backslash-escaped, or</p>
</li>
2023-03-04 22:38:38 +05:30
<li data-sourcepos="10450:1-10453:0">
<p data-sourcepos="10450:3-10452:20">a sequence of zero or more characters between matching parentheses
2023-01-13 00:05:48 +05:30
(<code>(...)</code>), including a <code>(</code> or <code>)</code> character only if it is
backslash-escaped.</p>
</li>
</ul>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10454:1-10455:15" dir="auto">Although [link titles] may span multiple lines, they may not contain
2023-01-13 00:05:48 +05:30
a [blank line].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10457:1-10467:6" dir="auto">An <a href="@">inline link</a> consists of a [link text] followed immediately
2023-01-13 00:05:48 +05:30
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>&lt;...&gt;</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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10469:1-10469:29" dir="auto">Here is a simple inline link:</p>
<div>
<div><a href="#example-493">Example 493</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10474:1-10476:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10478:1-10480:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri" title="title"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10484:1-10484:25" dir="auto">The title may be omitted:</p>
<div>
<div><a href="#example-494">Example 494</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10489:1-10491:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10493:1-10495:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10499:1-10499:50" dir="auto">Both the title and the destination may be omitted:</p>
<div>
<div><a href="#example-495">Example 495</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10504: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">[link]()</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10508:1-10510:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href=""&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-496">Example 496</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10517:1-10519:32" lang="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](&lt;&gt;)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10521:1-10523:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href=""&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10526:1-10527:28" dir="auto">The destination can only contain spaces if it is
2023-01-13 00:05:48 +05:30
enclosed in pointy brackets:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-497">Example 497</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10532:1-10534:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10536:1-10538:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[link](/my uri)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-498">Example 498</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10544:1-10546:32" lang="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](&lt;/my uri&gt;)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10548:1-10550:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/my%20uri"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10553:1-10554:36" dir="auto">The destination cannot contain line breaks,
2023-01-13 00:05:48 +05:30
even if enclosed in pointy brackets:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-499">Example 499</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10559:1-10562:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10564:1-10567:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[link](foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar)&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-500">Example 500</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10573:1-10576:32" lang="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](&lt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&gt;)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10578:1-10581:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[link](&lt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&gt;)&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10584:1-10585:19" dir="auto">The destination can contain <code>)</code> if it is enclosed
2023-01-13 00:05:48 +05:30
in pointy brackets:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-501">Example 501</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10590:1-10592:32" lang="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](&lt;b)c&gt;)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10594:1-10596:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="b)c"&gt;a&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10599:1-10599:53" dir="auto">Pointy brackets that enclose links must be unescaped:</p>
<div>
<div><a href="#example-502">Example 502</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10604:1-10606:32" lang="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](&lt;foo\&gt;)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10608:1-10610:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[link](&amp;lt;foo&amp;gt;)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10613:1-10614:24" dir="auto">These are not links, because the opening pointy bracket
2023-01-13 00:05:48 +05:30
is not matched properly:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-503">Example 503</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10619: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">[a](&lt;b)c</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">[a](&lt;b)c&gt;</span>
<span id="LC3" class="line" lang="plaintext">[a](&lt;b&gt;c)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10625:1-10629:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[a](&amp;lt;b)c</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">[a](&amp;lt;b)c&amp;gt;</span>
<span id="LC3" class="line" lang="plaintext">[a](&lt;b&gt;c)&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10632:1-10632:55" dir="auto">Parentheses inside the link destination may be escaped:</p>
<div>
<div><a href="#example-504">Example 504</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10637:1-10639:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10641:1-10643:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="(foo)"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10646:1-10647:9" dir="auto">Any number of parentheses are allowed without escaping, as long as they are
2023-01-13 00:05:48 +05:30
balanced:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-505">Example 505</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10652:1-10654:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10656:1-10658:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="foo(and(bar))"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10661:1-10662:13" dir="auto">However, if you have unbalanced parentheses, you need to escape or use the
2023-01-13 00:05:48 +05:30
<code>&lt;...&gt;</code> form:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-506">Example 506</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10667:1-10669:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10671:1-10673:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="foo(and(bar)"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-507">Example 507</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10680:1-10682:32" lang="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](&lt;foo(and(bar)&gt;)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10684:1-10686:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="foo(and(bar)"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10690:1-10691:12" dir="auto">Parentheses and other symbols can also be escaped, as usual
2023-01-13 00:05:48 +05:30
in Markdown:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-508">Example 508</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10696:1-10698:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10700:1-10702:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="foo):"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10706:1-10706:52" dir="auto">A link can contain fragment identifiers and queries:</p>
<div>
<div><a href="#example-509">Example 509</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10711:1-10717:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10719:1-10723:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="#fragment"&gt;link&lt;/a&gt;&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://example.com#fragment"&gt;link&lt;/a&gt;&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://example.com?foo=3#frag"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10727:1-10728:17" dir="auto">Note that a backslash before a non-escapable character is
2023-01-13 00:05:48 +05:30
just a backslash:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-510">Example 510</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10733:1-10735:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10737:1-10739:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="foo%5Cbar"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10743:1-10750:52" dir="auto">URL-escaping should be left alone inside the destination, as all
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-511">Example 511</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10755:1-10757:32" lang="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&amp;auml;)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10759:1-10761:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="foo%20b%C3%A4"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10765:1-10767:23" dir="auto">Note that, because titles can often be parsed as destinations,
2023-01-13 00:05:48 +05:30
if you try to omit the destination and keep the title, you'll
get unexpected results:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-512">Example 512</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10772:1-10774:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10776:1-10778:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="%22title%22"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10782:1-10782:62" dir="auto">Titles may be in single quotes, double quotes, or parentheses:</p>
<div>
<div><a href="#example-513">Example 513</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10787:1-10791:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10793:1-10797:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;link&lt;/a&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;a href="/url" title="title"&gt;link&lt;/a&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;a href="/url" title="title"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10801:1-10802:22" dir="auto">Backslash escapes and entity and numeric character references
2023-01-13 00:05:48 +05:30
may be used in titles:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-514">Example 514</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10807:1-10809:32" lang="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 \"&amp;quot;")</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10811:1-10813:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title &amp;quot;&amp;quot;"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10817:1-10818:64" dir="auto">Titles must be separated from the link using a [whitespace].
2023-01-13 00:05:48 +05:30
Other [Unicode whitespace] like non-breaking space doesn't work.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-515">Example 515</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10823:1-10825:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10827:1-10829:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url%C2%A0%22title%22"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10833:1-10833:56" dir="auto">Nested balanced quotes are not allowed without escaping:</p>
<div>
<div><a href="#example-516">Example 516</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10838:1-10840:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10842:1-10844:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[link](/url &amp;quot;title &amp;quot;and&amp;quot; title&amp;quot;)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10848:1-10848:67" dir="auto">But it is easy to work around this by using a different quote type:</p>
<div>
<div><a href="#example-517">Example 517</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">[link](/url 'title "and" title')</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">&lt;p&gt;&lt;a href="/url" title="title &amp;quot;and&amp;quot; title"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10863:1-10876:61" dir="auto">(Note: <code>Markdown.pl</code> did allow double quotes inside a double-quoted
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="10878:1-10878:57" dir="auto">[Whitespace] is allowed around the destination and title:</p>
<div>
<div><a href="#example-518">Example 518</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10883:1-10886:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10888:1-10890:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri" title="title"&gt;link&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10894:1-10895:22" dir="auto">But it is not allowed between the link text and the
2023-01-13 00:05:48 +05:30
following parenthesis:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-519">Example 519</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10900:1-10902:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10904:1-10906:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[link] (/uri)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10910:1-10911:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones,
2023-01-13 00:05:48 +05:30
unless they are escaped:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-520">Example 520</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10916:1-10918:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10920:1-10922:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;link [foo [bar]]&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-521">Example 521</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10929:1-10931:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10933:1-10935:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[link] bar](/uri)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-522">Example 522</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10942:1-10944:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10946:1-10948:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[link &lt;a href="/uri"&gt;bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-523">Example 523</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10955:1-10957:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10959:1-10961:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;link [bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10965:1-10965:41" dir="auto">The link text may contain inline content:</p>
<div>
<div><a href="#example-524">Example 524</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10970:1-10972:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10974:1-10976:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;link &lt;em&gt;foo &lt;strong&gt;bar&lt;/strong&gt; &lt;code&gt;#&lt;/code&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-525">Example 525</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10983:1-10985:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10987:1-10989:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;&lt;img src="moon.jpg" alt="moon" /&gt;&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="10993:1-10993:68" dir="auto">However, links may not contain other links, at any level of nesting.</p>
<div>
<div><a href="#example-526">Example 526</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="10998:1-11000:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11002:1-11004:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo &lt;a href="/uri"&gt;bar&lt;/a&gt;](/uri)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-527">Example 527</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11011:1-11013:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11015:1-11017:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo &lt;em&gt;[bar &lt;a href="/uri"&gt;baz&lt;/a&gt;](/uri)&lt;/em&gt;](/uri)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-528">Example 528</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11024:1-11026:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11028:1-11030:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="uri3" alt="[foo](uri2)" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11034:1-11035:18" dir="auto">These cases illustrate the precedence of link text grouping over
2023-01-13 00:05:48 +05:30
emphasis grouping:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-529">Example 529</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11040:1-11042:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11044:1-11046:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*&lt;a href="/uri"&gt;foo*&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-530">Example 530</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11053:1-11055:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11057:1-11059:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="baz*"&gt;foo *bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11063:1-11064:11" dir="auto">Note that brackets that <em>aren't</em> part of links do not take
2023-01-13 00:05:48 +05:30
precedence:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-531">Example 531</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11069:1-11071:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11073: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">&lt;p&gt;&lt;em&gt;foo [bar&lt;/em&gt; baz]&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11079:1-11080:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans,
2023-01-13 00:05:48 +05:30
and autolinks over link grouping:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-532">Example 532</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11085:1-11087:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo &lt;bar attr="](baz)"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11089:1-11091:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo &lt;bar attr="](baz)"&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-533">Example 533</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11098:1-11100:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11102:1-11104:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo&lt;code&gt;](/uri)&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-534">Example 534</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11111:1-11113:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo&lt;http://example.com/?search=](uri)&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11115:1-11117:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo&lt;a href="http://example.com/?search=%5D(uri)"&gt;http://example.com/?search=](uri)&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11121:1-11123:41" dir="auto">There are three kinds of <a href="@">reference link</a>s:
2023-01-13 00:05:48 +05:30
<a href="#full-reference-link">full</a>, <a href="#collapsed-reference-link">collapsed</a>,
and <a href="#shortcut-reference-link">shortcut</a>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11125:1-11127:71" dir="auto">A <a href="@">full reference link</a>
2023-01-13 00:05:48 +05:30
consists of a [link text] immediately followed by a [link label]
that [matches] a [link reference definition] elsewhere in the document.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11129:1-11135:9" dir="auto">A <a href="@">link label</a> begins with a left bracket (<code>[</code>) and ends
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11137:1-11144:69" dir="auto">One label <a href="@">matches</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11146:1-11148:37" dir="auto">The contents of the first link label are parsed as inlines, which are
2023-01-13 00:05:48 +05:30
used as the link's text. The link's URI and title are provided by the
matching [link reference definition].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11150:1-11150:25" dir="auto">Here is a simple example:</p>
<div>
<div><a href="#example-535">Example 535</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<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">[foo][bar]</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11161:1-11163:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11167:1-11168:22" dir="auto">The rules for the [link text] are the same as with
2023-01-13 00:05:48 +05:30
[inline links]. Thus:</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11170:1-11171:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones,
2023-01-13 00:05:48 +05:30
unless they are escaped:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-536">Example 536</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11176:1-11180:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11182:1-11184:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;link [foo [bar]]&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-537">Example 537</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11191:1-11195:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11197:1-11199:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;link [bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11203:1-11203:41" dir="auto">The link text may contain inline content:</p>
<div>
<div><a href="#example-538">Example 538</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11208:1-11212:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11214:1-11216:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;link &lt;em&gt;foo &lt;strong&gt;bar&lt;/strong&gt; &lt;code&gt;#&lt;/code&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-539">Example 539</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11223:1-11227:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11229: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">&lt;p&gt;&lt;a href="/uri"&gt;&lt;img src="moon.jpg" alt="moon" /&gt;&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11235:1-11235:68" dir="auto">However, links may not contain other links, at any level of nesting.</p>
<div>
<div><a href="#example-540">Example 540</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11240:1-11244:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11246: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">&lt;p&gt;[foo &lt;a href="/uri"&gt;bar&lt;/a&gt;]&lt;a href="/uri"&gt;ref&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-541">Example 541</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11255:1-11259:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11261:1-11263:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo &lt;em&gt;bar &lt;a href="/uri"&gt;baz&lt;/a&gt;&lt;/em&gt;]&lt;a href="/uri"&gt;ref&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11267:1-11268:38" dir="auto">(In the examples above, we have two [shortcut reference links]
2023-01-13 00:05:48 +05:30
instead of one [full reference link].)</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11270:1-11271:18" dir="auto">The following cases illustrate the precedence of link text grouping over
2023-01-13 00:05:48 +05:30
emphasis grouping:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-542">Example 542</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11276:1-11280:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11282:1-11284:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*&lt;a href="/uri"&gt;foo*&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-543">Example 543</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11291:1-11295:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11297:1-11299:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;foo *bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11303:1-11304:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans,
2023-01-13 00:05:48 +05:30
and autolinks over link grouping:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-544">Example 544</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11309:1-11313:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo &lt;bar attr="][ref]"&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11315:1-11317:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo &lt;bar attr="][ref]"&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-545">Example 545</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11324:1-11328:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11330:1-11332:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo&lt;code&gt;][ref]&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-546">Example 546</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11339:1-11343:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo&lt;http://example.com/?search=][ref]&gt;</span>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11345:1-11347:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo&lt;a href="http://example.com/?search=%5D%5Bref%5D"&gt;http://example.com/?search=][ref]&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11351:1-11351:29" dir="auto">Matching is case-insensitive:</p>
<div>
<div><a href="#example-547">Example 547</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11356:1-11360:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11362:1-11364:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11368:1-11368:26" dir="auto">Unicode case fold is used:</p>
<div>
<div><a href="#example-548">Example 548</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11373:1-11377:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11379:1-11381:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url"&gt;Толпой&lt;/a&gt; is a Russian word.&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11385:1-11386:33" dir="auto">Consecutive internal [whitespace] is treated as one space for
2023-01-13 00:05:48 +05:30
purposes of determining matching:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-549">Example 549</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11391:1-11396:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11398:1-11400:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url"&gt;Baz&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11404:1-11405:13" dir="auto">No [whitespace] is allowed between the [link text] and the
2023-01-13 00:05:48 +05:30
[link label]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-550">Example 550</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11410:1-11414:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11416:1-11418:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo] &lt;a href="/url" title="title"&gt;bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-551">Example 551</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11425:1-11430:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11432:1-11435:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo]</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;a href="/url" title="title"&gt;bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11439:1-11448:9" dir="auto">This is a departure from John Gruber's original Markdown syntax
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11450:1-11456:3" lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">[foo]</span>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11458:1-11464:20" dir="auto">(Note that [shortcut reference links] were introduced by Gruber
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11466:1-11467:18" dir="auto">When there are multiple matching [link reference definitions],
2023-01-13 00:05:48 +05:30
the first is used:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-552">Example 552</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11472:1-11478:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11480:1-11482:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url1"&gt;bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11486:1-11488:40" dir="auto">Note that matching is performed on normalized strings, not parsed
2023-01-13 00:05:48 +05:30
inline content. So the following does not match, even though the
labels define equivalent inline content:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-553">Example 553</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11493:1-11497:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11499:1-11501:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[bar][foo!]&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11505:1-11506:18" dir="auto">[Link labels] cannot contain brackets, unless they are
2023-01-13 00:05:48 +05:30
backslash-escaped:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-554">Example 554</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11511:1-11515:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11517:1-11520:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo][ref[]&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;[ref[]: /uri&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-555">Example 555</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11527:1-11531:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11533:1-11536:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo][ref[bar]]&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;[ref[bar]]: /uri&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-556">Example 556</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11543:1-11547:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11549:1-11552:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[[[foo]]]&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;[[[foo]]]: /url&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-557">Example 557</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11559:1-11563:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11565:1-11567:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11571:1-11571:55" dir="auto">Note that in this example <code>]</code> is not backslash-escaped:</p>
<div>
<div><a href="#example-558">Example 558</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11576:1-11580:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11582:1-11584:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/uri"&gt;bar\&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11588:1-11588:68" dir="auto">A [link label] must contain at least one [non-whitespace character]:</p>
<div>
<div><a href="#example-559">Example 559</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11593:1-11597:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11599:1-11602:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[]&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;[]: /uri&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-560">Example 560</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11609:1-11615:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11617:1-11622:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">]&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;[</span>
<span id="LC4" class="line" lang="plaintext">]: /uri&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11626:1-11633:40" dir="auto">A <a href="@">collapsed reference link</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-561">Example 561</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11638:1-11642:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11644:1-11646:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-562">Example 562</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11653:1-11657:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11659:1-11661:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;&lt;em&gt;foo&lt;/em&gt; bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11665:1-11665:37" dir="auto">The link labels are case-insensitive:</p>
<div>
<div><a href="#example-563">Example 563</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11670:1-11674:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11676:1-11678:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;Foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11683:1-11684:41" dir="auto">As with full reference links, [whitespace] is not
2023-01-13 00:05:48 +05:30
allowed between the two sets of brackets:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-564">Example 564</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11689:1-11694:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11696:1-11699:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;foo&lt;/a&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">[]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11703:1-11710:41" dir="auto">A <a href="@">shortcut reference link</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-565">Example 565</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11715:1-11719:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11721:1-11723:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-566">Example 566</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11730:1-11734:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11736:1-11738:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;&lt;em&gt;foo&lt;/em&gt; bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-567">Example 567</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11745:1-11749:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11751:1-11753:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[&lt;a href="/url" title="title"&gt;&lt;em&gt;foo&lt;/em&gt; bar&lt;/a&gt;]&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-568">Example 568</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11760:1-11764:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11766:1-11768:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[[bar &lt;a href="/url"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11772:1-11772:37" dir="auto">The link labels are case-insensitive:</p>
<div>
<div><a href="#example-569">Example 569</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11777:1-11781:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11783:1-11785:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url" title="title"&gt;Foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11789:1-11789:48" dir="auto">A space after the link text should be preserved:</p>
<div>
<div><a href="#example-570">Example 570</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11794:1-11798:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11800:1-11802:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url"&gt;foo&lt;/a&gt; bar&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11806:1-11807:31" dir="auto">If you just want bracketed text, you can backslash-escape the
2023-01-13 00:05:48 +05:30
opening bracket to avoid links:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-571">Example 571</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11812:1-11816:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11818:1-11820:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo]&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11824:1-11825:26" dir="auto">Note that this is a link, because a link label ends with the first
2023-01-13 00:05:48 +05:30
following closing bracket:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-572">Example 572</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11830:1-11834:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11836:1-11838:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;*&lt;a href="/url"&gt;foo*&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11842:1-11843:11" dir="auto">Full and compact references take precedence over shortcut
2023-01-13 00:05:48 +05:30
references:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-573">Example 573</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11848:1-11853:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11855:1-11857:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url2"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-574">Example 574</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11863:1-11867:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11869:1-11871:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url1"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11874:1-11874:34" dir="auto">Inline links also take precedence:</p>
<div>
<div><a href="#example-575">Example 575</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11879:1-11883:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11885:1-11887:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href=""&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-576">Example 576</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11893:1-11897:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11899:1-11901:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url1"&gt;foo&lt;/a&gt;(not a link)&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11904:1-11905:23" dir="auto">In the following case <code>[bar][baz]</code> is parsed as a reference,
2023-01-13 00:05:48 +05:30
<code>[foo]</code> as normal text:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-577">Example 577</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11910:1-11914:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11916:1-11918:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo]&lt;a href="/url"&gt;bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11922:1-11923:19" dir="auto">Here, though, <code>[foo][bar]</code> is parsed as a reference, since
2023-01-13 00:05:48 +05:30
<code>[bar]</code> is defined:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-578">Example 578</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11928:1-11933:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11935:1-11937:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="/url2"&gt;foo&lt;/a&gt;&lt;a href="/url1"&gt;baz&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="11941:1-11942:65" dir="auto">Here <code>[foo]</code> is not parsed as a shortcut reference, because it
2023-01-13 00:05:48 +05:30
is followed by a link label (even though <code>[bar]</code> is not defined):</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-579">Example 579</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11947:1-11952:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11954:1-11956:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[foo]&lt;a href="/url1"&gt;bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="11961:1-11961:9" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-images" class="anchor" href="#images" aria-hidden="true"></a>Images</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="11963:1-11971:55" dir="auto">Syntax for images is like the syntax for links, with one
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-580">Example 580</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11976:1-11978:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11980:1-11982:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="foo" title="title" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-581">Example 581</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11989:1-11993:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">[foo *bar*]: train.jpg "train &amp; tracks"</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="11995:1-11997:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="train.jpg" alt="foo bar" title="train &amp;amp; tracks" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-582">Example 582</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12004:1-12006:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12008:1-12010:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url2" alt="foo bar" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-583">Example 583</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12017:1-12019:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12021:1-12023:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url2" alt="foo bar" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12027:1-12032:40" dir="auto">Though this spec is concerned with parsing, not rendering, it is
2023-01-13 00:05:48 +05:30
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 &lt;a href="/url"&gt;bar&lt;/a&gt;</code>. Only the plain string
content is rendered, without formatting.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-584">Example 584</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12037:1-12041:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">[foo *bar*]: train.jpg "train &amp; tracks"</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12043:1-12045:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="train.jpg" alt="foo bar" title="train &amp;amp; tracks" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-585">Example 585</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12052:1-12056:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">[FOOBAR]: train.jpg "train &amp; tracks"</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12058:1-12060:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="train.jpg" alt="foo bar" title="train &amp;amp; tracks" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-586">Example 586</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12067:1-12069:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12071:1-12073:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="train.jpg" alt="foo" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-587">Example 587</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12080:1-12082:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12084:1-12086:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;My &lt;img src="/path/to/train.jpg" alt="foo bar" title="title" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-588">Example 588</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12093:1-12095:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](&lt;url&gt;)</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12097:1-12099:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="url" alt="foo" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-589">Example 589</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12106:1-12108:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12110:1-12112:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12116:1-12116:16" dir="auto">Reference-style:</p>
<div>
<div><a href="#example-590">Example 590</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12121:1-12125:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12127:1-12129:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="foo" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-591">Example 591</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12136:1-12140:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12142:1-12144:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="foo" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12148:1-12148:10" dir="auto">Collapsed:</p>
<div>
<div><a href="#example-592">Example 592</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12153:1-12157:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12159:1-12161:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="foo" title="title" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-593">Example 593</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12168:1-12172:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12174:1-12176:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="foo bar" title="title" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12180:1-12180:32" dir="auto">The labels are case-insensitive:</p>
<div>
<div><a href="#example-594">Example 594</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12185:1-12189:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12191:1-12193:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="Foo" title="title" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12197:1-12198:33" dir="auto">As with reference links, [whitespace] is not allowed
2023-01-13 00:05:48 +05:30
between the two sets of brackets:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-595">Example 595</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12203:1-12208:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12210:1-12213:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="foo" title="title" /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">[]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12217:1-12217:9" dir="auto">Shortcut:</p>
<div>
<div><a href="#example-596">Example 596</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12222:1-12226:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12228:1-12230:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="foo" title="title" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-597">Example 597</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12237:1-12241:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12243:1-12245:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="foo bar" title="title" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12249:1-12249:56" dir="auto">Note that link labels cannot contain unescaped brackets:</p>
<div>
<div><a href="#example-598">Example 598</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12254:1-12258:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12260:1-12263:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;![[foo]]&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;[[foo]]: /url &amp;quot;title&amp;quot;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12267:1-12267:37" dir="auto">The link labels are case-insensitive:</p>
<div>
<div><a href="#example-599">Example 599</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12272:1-12276:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12278:1-12280:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="/url" alt="Foo" title="title" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12284:1-12285:33" dir="auto">If you just want a literal <code>!</code> followed by bracketed text, you can
2023-01-13 00:05:48 +05:30
backslash-escape the opening <code>[</code>:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-600">Example 600</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12290:1-12294:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12296:1-12298:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;![foo]&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12302:1-12303:4" dir="auto">If you want a link after a literal <code>!</code>, backslash-escape the
2023-01-13 00:05:48 +05:30
<code>!</code>:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-601">Example 601</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12308:1-12312:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12314:1-12316:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;!&lt;a href="/url" title="title"&gt;foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="12320:1-12320:12" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-autolinks" class="anchor" href="#autolinks" aria-hidden="true"></a>Autolinks</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12322:1-12324:18" dir="auto"><a href="@">Autolink</a>s are absolute URIs and email addresses inside
2023-01-13 00:05:48 +05:30
<code>&lt;</code> and <code>&gt;</code>. They are parsed as links, with the URL or email address
as the link label.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12326:1-12328:52" dir="auto">A <a href="@">URI autolink</a> consists of <code>&lt;</code>, followed by an
2023-01-13 00:05:48 +05:30
[absolute URI] followed by <code>&gt;</code>. It is parsed as
a link to the URI, with the URI as the link's label.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12330:1-12335:25" dir="auto">An <a href="@">absolute URI</a>,
2023-01-13 00:05:48 +05:30
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>&lt;</code>, and <code>&gt;</code>. If
the URI includes these characters, they must be percent-encoded
(e.g. <code>%20</code> for a space).</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12337:1-12340:37" dir="auto">For purposes of this spec, a <a href="@">scheme</a> is any sequence
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12342:1-12342:30" dir="auto">Here are some valid autolinks:</p>
<div>
<div><a href="#example-602">Example 602</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12347:1-12349:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;http://foo.bar.baz&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12351:1-12353:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://foo.bar.baz"&gt;http://foo.bar.baz&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-603">Example 603</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12360:1-12362:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12364:1-12366:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://foo.bar.baz/test?q=hello&amp;amp;id=22&amp;amp;boolean"&gt;http://foo.bar.baz/test?q=hello&amp;amp;id=22&amp;amp;boolean&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-604">Example 604</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12373:1-12375:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;irc://foo.bar:2233/baz&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12377:1-12379:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="irc://foo.bar:2233/baz"&gt;irc://foo.bar:2233/baz&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12383:1-12383:23" dir="auto">Uppercase is also fine:</p>
<div>
<div><a href="#example-605">Example 605</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12388:1-12390:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;MAILTO:FOO@BAR.BAZ&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12392:1-12394:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="MAILTO:FOO@BAR.BAZ"&gt;MAILTO:FOO@BAR.BAZ&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12398:1-12401:18" dir="auto">Note that many strings that count as [absolute URIs] for
2023-01-13 00:05:48 +05:30
purposes of this spec are not valid URIs, because their
schemes are not registered or because of other problems
with their syntax:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-606">Example 606</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12406:1-12408:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a+b+c:d&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12410:1-12412:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="a+b+c:d"&gt;a+b+c:d&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-607">Example 607</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12419:1-12421:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;made-up-scheme://foo,bar&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12423:1-12425:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="made-up-scheme://foo,bar"&gt;made-up-scheme://foo,bar&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-608">Example 608</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12432:1-12434:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;http://../&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12436:1-12438:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://../"&gt;http://../&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-609">Example 609</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12445:1-12447:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;localhost:5001/foo&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12449:1-12451:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="localhost:5001/foo"&gt;localhost:5001/foo&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12455:1-12455:36" dir="auto">Spaces are not allowed in autolinks:</p>
<div>
<div><a href="#example-610">Example 610</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12460:1-12462:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;http://foo.bar/baz bim&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12464:1-12466:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;http://foo.bar/baz bim&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12470:1-12470:47" dir="auto">Backslash-escapes do not work inside autolinks:</p>
<div>
<div><a href="#example-611">Example 611</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12475:1-12477:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;http://example.com/\[\&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12479:1-12481:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://example.com/%5C%5B%5C"&gt;http://example.com/\[\&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12485:1-12488:55" dir="auto">An <a href="@">email autolink</a>
2023-01-13 00:05:48 +05:30
consists of <code>&lt;</code>, followed by an [email address],
followed by <code>&gt;</code>. The link's label is the email address,
and the URL is <code>mailto:</code> followed by the email address.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12490:1-12493:83" dir="auto">An <a href="@">email address</a>,
2023-01-13 00:05:48 +05:30
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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12495:5-12497: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.!#$%&amp;'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?</span>
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12498:1-12498:28" dir="auto">Examples of email autolinks:</p>
<div>
<div><a href="#example-612">Example 612</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12503:1-12505:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;foo@bar.example.com&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12507:1-12509:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="mailto:foo@bar.example.com"&gt;foo@bar.example.com&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-613">Example 613</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12516:1-12518:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;foo+special@Bar.baz-bar0.com&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12520:1-12522:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="mailto:foo+special@Bar.baz-bar0.com"&gt;foo+special@Bar.baz-bar0.com&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12526:1-12526:53" dir="auto">Backslash-escapes do not work inside email autolinks:</p>
<div>
<div><a href="#example-614">Example 614</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12531:1-12533:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;foo\+@bar.example.com&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12535:1-12537:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;foo+@bar.example.com&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12541:1-12541:24" dir="auto">These are not autolinks:</p>
<div>
<div><a href="#example-615">Example 615</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12546:1-12548:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12550:1-12552:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-616">Example 616</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12559:1-12561:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt; http://foo.bar &gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12563:1-12565:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt; http://foo.bar &amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-617">Example 617</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12572:1-12574:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;m:abc&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12576:1-12578:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;m:abc&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-618">Example 618</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12585:1-12587:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;foo.bar.baz&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12589:1-12591:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;foo.bar.baz&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-619">Example 619</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12598:1-12600:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12602:1-12604:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;http://example.com&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-620">Example 620</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12611:1-12613:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12615:1-12617:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo@bar.example.com&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
2023-01-13 00:05:48 +05:30
<div>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="12622:1-12622:24">
2023-01-13 00:05:48 +05:30
<a id="user-content-autolinks-extension" class="anchor" href="#autolinks-extension" aria-hidden="true"></a>Autolinks (extension)</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12624:1-12625:29">GFM enables the <code>autolink</code> extension, where autolinks will be recognised in a
2023-01-13 00:05:48 +05:30
greater number of conditions.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12627:1-12631:8">[Autolink]s can also be constructed without requiring the use of <code>&lt;</code> and to <code>&gt;</code>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12633:1-12639:73">An <a href="@">extended www autolink</a> will be recognized
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12641:1-12641:49">The scheme <code>http</code> will be inserted automatically:</p>
<div>
<div><a href="#example-621">Example 621</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12646:1-12648:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12650:1-12652:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://www.commonmark.org"&gt;www.commonmark.org&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12655:1-12655:77">After a [valid domain], zero or more non-space non-<code>&lt;</code> characters may follow:</p>
<div>
<div><a href="#example-622">Example 622</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12660:1-12662:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12664:1-12666:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Visit &lt;a href="http://www.commonmark.org/help"&gt;www.commonmark.org/help&lt;/a&gt; for more information.&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12669:1-12669:64">We then apply <a href="@">extended autolink path validation</a> as follows:</p>
<p data-sourcepos="12671:1-12673:21">Trailing punctuation (specifically, <code>?</code>, <code>!</code>, <code>.</code>, <code>,</code>, <code>:</code>, <code>*</code>, <code>_</code>, and <code>~</code>)
2023-01-13 00:05:48 +05:30
will not be considered part of the autolink, though they may be included in the
interior of the link:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-623">Example 623</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12678:1-12682:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12684:1-12687:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Visit &lt;a href="http://www.commonmark.org"&gt;www.commonmark.org&lt;/a&gt;.&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;Visit &lt;a href="http://www.commonmark.org/a.b"&gt;www.commonmark.org/a.b&lt;/a&gt;.&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12690:1-12693:76">When an autolink ends in <code>)</code>, we scan the entire autolink for the total number
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-624">Example 624</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12698:1-12706:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12708:1-12713:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://www.google.com/search?q=Markup+(business)"&gt;www.google.com/search?q=Markup+(business)&lt;/a&gt;&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://www.google.com/search?q=Markup+(business)"&gt;www.google.com/search?q=Markup+(business)&lt;/a&gt;))&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;(&lt;a href="http://www.google.com/search?q=Markup+(business)"&gt;www.google.com/search?q=Markup+(business)&lt;/a&gt;)&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;(&lt;a href="http://www.google.com/search?q=Markup+(business)"&gt;www.google.com/search?q=Markup+(business)&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12716:1-12718:8">This check is only done when the link ends in a closing parentheses <code>)</code>, so if
2023-01-13 00:05:48 +05:30
the only parentheses are in the interior of the autolink, no special rules are
applied:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-625">Example 625</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12723:1-12725:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12727:1-12729:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://www.google.com/search?q=(business))+ok"&gt;www.google.com/search?q=(business))+ok&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12732:1-12735:13">If an autolink ends in a semicolon (<code>;</code>), we check to see if it appears to
2023-01-13 00:05:48 +05:30
resemble an [entity reference][entity references]; if the preceding text is <code>&amp;</code>
followed by one or more alphanumeric characters. If so, it is excluded from
the autolink:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-626">Example 626</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12740:1-12744:32" lang="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&amp;hl=en</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">www.google.com/search?q=commonmark&amp;hl;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12746:1-12749:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://www.google.com/search?q=commonmark&amp;amp;hl=en"&gt;www.google.com/search?q=commonmark&amp;amp;hl=en&lt;/a&gt;&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://www.google.com/search?q=commonmark"&gt;www.google.com/search?q=commonmark&lt;/a&gt;&amp;amp;hl;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12752:1-12752:33"><code>&lt;</code> immediately ends an autolink.</p>
<div>
<div><a href="#example-627">Example 627</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12757:1-12759:32" lang="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&lt;lp</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12761:1-12763:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://www.commonmark.org/he"&gt;www.commonmark.org/he&lt;/a&gt;&amp;lt;lp&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12766:1-12769:36">An <a href="@">extended url autolink</a> will be recognised when one of the schemes
2023-01-13 00:05:48 +05:30
<code>http://</code>, <code>https://</code>, or <code>ftp://</code>, followed by a [valid domain], then zero or
more non-space non-<code>&lt;</code> characters according to
[extended autolink path validation]:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-628">Example 628</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12774:1-12780:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12782:1-12786:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="http://commonmark.org"&gt;http://commonmark.org&lt;/a&gt;&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;(Visit &lt;a href="https://encrypted.google.com/search?q=Markup+(business)"&gt;https://encrypted.google.com/search?q=Markup+(business)&lt;/a&gt;)&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;Anonymous FTP is available at &lt;a href="ftp://foo.bar.baz"&gt;ftp://foo.bar.baz&lt;/a&gt;.&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12790:1-12792:20">An <a href="@">extended email autolink</a> will be recognised when an email address is
2023-01-13 00:05:48 +05:30
recognised within any text node. Email addresses are recognised according to
the following rules:</p>
2023-03-04 22:38:38 +05:30
<ul data-sourcepos="12794:1-12800:0">
<li data-sourcepos="12794:1-12794:75">One ore more characters which are alphanumeric, or <code>.</code>, <code>-</code>, <code>_</code>, or <code>+</code>.</li>
<li data-sourcepos="12795:1-12795:16">An <code>@</code> symbol.</li>
<li data-sourcepos="12796:1-12800:0">One or more characters which are alphanumeric, or <code>-</code> or <code>_</code>,
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12801:1-12801:71">The scheme <code>mailto:</code> will automatically be added to the generated link:</p>
<div>
<div><a href="#example-629">Example 629</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12806:1-12808:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12810:1-12812:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="mailto:foo@bar.baz"&gt;foo@bar.baz&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12815:1-12815:44"><code>+</code> can occur before the <code>@</code>, but not after.</p>
<div>
<div><a href="#example-630">Example 630</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12820:1-12822:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12824:1-12826:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;hello@mail+xyz.example isn't valid, but &lt;a href="mailto:hello+xyz@mail.example"&gt;hello+xyz@mail.example&lt;/a&gt; is.&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12829:1-12831:12"><code>.</code>, <code>-</code>, and <code>_</code> can occur on both sides of the <code>@</code>, but only <code>.</code> may occur at
2023-01-13 00:05:48 +05:30
the end of the email address, in which case it will not be considered part of
the address:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-631">Example 631</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12836:1-12844:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12846:1-12851:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="mailto:a.b-c_d@a.b"&gt;a.b-c_d@a.b&lt;/a&gt;&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;&lt;a href="mailto:a.b-c_d@a.b"&gt;a.b-c_d@a.b&lt;/a&gt;.&lt;/p&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;a.b-c_d@a.b-&lt;/p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;p&gt;a.b-c_d@a.b_&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="12856:1-12856:11" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-raw-html" class="anchor" href="#raw-html" aria-hidden="true"></a>Raw HTML</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12858:1-12861:57" dir="auto">Text between <code>&lt;</code> and <code>&gt;</code> that looks like an HTML tag is parsed as a
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12863:1-12863:29" dir="auto">Here is the grammar for tags:</p>
<p data-sourcepos="12865:1-12867:14" dir="auto">A <a href="@">tag name</a> consists of an ASCII letter
2023-01-13 00:05:48 +05:30
followed by zero or more ASCII letters, digits, or
hyphens (<code>-</code>).</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12869:1-12871:32" dir="auto">An <a href="@">attribute</a> consists of [whitespace],
2023-01-13 00:05:48 +05:30
an [attribute name], and an optional
[attribute value specification].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12873:1-12876:52" dir="auto">An <a href="@">attribute name</a>
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12878:1-12881:7" dir="auto">An <a href="@">attribute value specification</a>
2023-01-13 00:05:48 +05:30
consists of optional [whitespace],
a <code>=</code> character, optional [whitespace], and an [attribute
value].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12883:1-12885:72" dir="auto">An <a href="@">attribute value</a>
2023-01-13 00:05:48 +05:30
consists of an [unquoted attribute value],
a [single-quoted attribute value], or a [double-quoted attribute value].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12887:1-12889:60" dir="auto">An <a href="@">unquoted attribute value</a>
2023-01-13 00:05:48 +05:30
is a nonempty string of characters not
including [whitespace], <code>"</code>, <code>'</code>, <code>=</code>, <code>&lt;</code>, <code>&gt;</code>, or <code>`</code>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12891:1-12893:46" dir="auto">A <a href="@">single-quoted attribute value</a>
2023-01-13 00:05:48 +05:30
consists of <code>'</code>, zero or more
characters not including <code>'</code>, and a final <code>'</code>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12895:1-12897:46" dir="auto">A <a href="@">double-quoted attribute value</a>
2023-01-13 00:05:48 +05:30
consists of <code>"</code>, zero or more
characters not including <code>"</code>, and a final <code>"</code>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12899:1-12901:31" dir="auto">An <a href="@">open tag</a> consists of a <code>&lt;</code> character, a [tag name],
2023-01-13 00:05:48 +05:30
zero or more [attributes], optional [whitespace], an optional <code>/</code>
character, and a <code>&gt;</code> character.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12903:1-12904:57" dir="auto">A <a href="@">closing tag</a> consists of the string <code>&lt;/</code>, a
2023-01-13 00:05:48 +05:30
[tag name], optional [whitespace], and the character <code>&gt;</code>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12906:1-12909:63" dir="auto">An <a href="@">HTML comment</a> consists of <code>&lt;!--</code> + <em>text</em> + <code>--&gt;</code>,
2023-01-13 00:05:48 +05:30
where <em>text</em> does not start with <code>&gt;</code> or <code>-&gt;</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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12911:1-12914:5" dir="auto">A <a href="@">processing instruction</a>
2023-01-13 00:05:48 +05:30
consists of the string <code>&lt;?</code>, a string
of characters not including the string <code>?&gt;</code>, and the string
<code>?&gt;</code>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12916:1-12919:37" dir="auto">A <a href="@">declaration</a> consists of the
2023-01-13 00:05:48 +05:30
string <code>&lt;!</code>, a name consisting of one or more uppercase ASCII letters,
[whitespace], a string of characters not including the
character <code>&gt;</code>, and the character <code>&gt;</code>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12921:1-12923:28" dir="auto">A <a href="@">CDATA section</a> consists of
2023-01-13 00:05:48 +05:30
the string <code>&lt;![CDATA[</code>, a string of characters not including the string
<code>]]&gt;</code>, and the string <code>]]&gt;</code>.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12925:1-12927:21" dir="auto">An <a href="@">HTML tag</a> consists of an [open tag], a [closing tag],
2023-01-13 00:05:48 +05:30
an [HTML comment], a [processing instruction], a [declaration],
or a [CDATA section].</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="12929:1-12929:31" dir="auto">Here are some simple open tags:</p>
<div>
<div><a href="#example-632">Example 632</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12934:1-12936:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a&gt;&lt;bab&gt;&lt;c2c&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12938:1-12940:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a&gt;&lt;bab&gt;&lt;c2c&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12944:1-12944:15" dir="auto">Empty elements:</p>
<div>
<div><a href="#example-633">Example 633</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12949:1-12951:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a/&gt;&lt;b2/&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12953:1-12955:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a/&gt;&lt;b2/&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12959:1-12959:24" dir="auto">[Whitespace] is allowed:</p>
<div>
<div><a href="#example-634">Example 634</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12964:1-12967:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a /&gt;&lt;b2</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">data="foo" &gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12969:1-12972:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a /&gt;&lt;b2</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">data="foo" &gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12976:1-12976:16" dir="auto">With attributes:</p>
<div>
<div><a href="#example-635">Example 635</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12981:1-12984:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a foo="bar" bam = 'baz &lt;em&gt;"&lt;/em&gt;'</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">_boolean zoop:33=zoop:33 /&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12986:1-12989:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a foo="bar" bam = 'baz &lt;em&gt;"&lt;/em&gt;'</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">_boolean zoop:33=zoop:33 /&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="12993:1-12993:29" dir="auto">Custom tag names can be used:</p>
<div>
<div><a href="#example-636">Example 636</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="12998:1-13000:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo &lt;responsive-image src="foo.jpg" /&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13002:1-13004:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo &lt;responsive-image src="foo.jpg" /&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13008:1-13008:38" dir="auto">Illegal tag names, not parsed as HTML:</p>
<div>
<div><a href="#example-637">Example 637</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13013:1-13015:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;33&gt; &lt;__&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13017:1-13019:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;33&amp;gt; &amp;lt;__&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13023:1-13023:24" dir="auto">Illegal attribute names:</p>
<div>
<div><a href="#example-638">Example 638</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13028:1-13030:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a h*#ref="hi"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13032:1-13034:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;a h*#ref=&amp;quot;hi&amp;quot;&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13038:1-13038:25" dir="auto">Illegal attribute values:</p>
<div>
<div><a href="#example-639">Example 639</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13043:1-13045:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="hi'&gt; &lt;a href=hi'&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13047:1-13049:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;a href=&amp;quot;hi'&amp;gt; &amp;lt;a href=hi'&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13053:1-13053:21" dir="auto">Illegal [whitespace]:</p>
<div>
<div><a href="#example-640">Example 640</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13058:1-13063:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt; a&gt;&lt;</span>
2023-01-13 00:05:48 +05:30
<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;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13065:1-13070:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt; a&amp;gt;&amp;lt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">foo&amp;gt;&amp;lt;bar/ &amp;gt;</span>
<span id="LC3" class="line" lang="plaintext">&amp;lt;foo bar=baz</span>
<span id="LC4" class="line" lang="plaintext">bim!bop /&amp;gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13074:1-13074:21" dir="auto">Missing [whitespace]:</p>
<div>
<div><a href="#example-641">Example 641</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13079:1-13081:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href='bar'title=title&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13083:1-13085:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;a href='bar'title=title&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13089:1-13089:13" dir="auto">Closing tags:</p>
<div>
<div><a href="#example-642">Example 642</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13094:1-13096:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;/a&gt;&lt;/foo &gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13098:1-13100:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;/a&gt;&lt;/foo &gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13104:1-13104:34" dir="auto">Illegal attributes in closing tag:</p>
<div>
<div><a href="#example-643">Example 643</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13109:1-13111:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;/a href="foo"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13113:1-13115:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;/a href=&amp;quot;foo&amp;quot;&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13119:1-13119:9" dir="auto">Comments:</p>
<div>
<div><a href="#example-644">Example 644</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13124:1-13127:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo &lt;!-- this is a</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">comment - with hyphen --&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13129:1-13132:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;!-- this is a</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">comment - with hyphen --&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-645">Example 645</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13139:1-13141:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo &lt;!-- not a comment -- two hyphens --&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13143:1-13145:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &amp;lt;!-- not a comment -- two hyphens --&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13149:1-13149:13" dir="auto">Not comments:</p>
<div>
<div><a href="#example-646">Example 646</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13154:1-13158:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo &lt;!--&gt; foo --&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">foo &lt;!-- foo---&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13160:1-13163:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &amp;lt;!--&amp;gt; foo --&amp;gt;&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;foo &amp;lt;!-- foo---&amp;gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13167:1-13167:24" dir="auto">Processing instructions:</p>
<div>
<div><a href="#example-647">Example 647</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13172:1-13174:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo &lt;?php echo $a; ?&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13176:1-13178:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;?php echo $a; ?&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13182:1-13182:13" dir="auto">Declarations:</p>
<div>
<div><a href="#example-648">Example 648</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13187:1-13189:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo &lt;!ELEMENT br EMPTY&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13191:1-13193:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;!ELEMENT br EMPTY&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13197:1-13197:15" dir="auto">CDATA sections:</p>
<div>
<div><a href="#example-649">Example 649</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13202:1-13204:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo &lt;![CDATA[&gt;&amp;&lt;]]&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13206:1-13208:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;![CDATA[&gt;&amp;&lt;]]&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13212:1-13213:11" dir="auto">Entity and numeric character references are preserved in HTML
2023-01-13 00:05:48 +05:30
attributes:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-650">Example 650</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13218:1-13220:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo &lt;a href="&amp;ouml;"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13222:1-13224:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;a href="&amp;ouml;"&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13228:1-13228:49" dir="auto">Backslash escapes do not work in HTML attributes:</p>
<div>
<div><a href="#example-651">Example 651</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13233:1-13235:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo &lt;a href="\*"&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13237:1-13239:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo &lt;a href="\*"&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-652">Example 652</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13246:1-13248:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="\""&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13250:1-13252:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&amp;lt;a href=&amp;quot;&amp;quot;&amp;quot;&amp;gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
2023-01-13 00:05:48 +05:30
<div>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="13258:1-13258:34">
2023-01-13 00:05:48 +05:30
<a id="user-content-disallowed-raw-html-extension" class="anchor" href="#disallowed-raw-html-extension" aria-hidden="true"></a>Disallowed Raw HTML (extension)</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13260:1-13261:36">GFM enables the <code>tagfilter</code> extension, where the following HTML tags will be
2023-01-13 00:05:48 +05:30
filtered when rendering HTML output:</p>
2023-03-04 22:38:38 +05:30
<ul data-sourcepos="13263:1-13272:0">
<li data-sourcepos="13263:1-13263:11"><code>&lt;title&gt;</code></li>
<li data-sourcepos="13264:1-13264:14"><code>&lt;textarea&gt;</code></li>
<li data-sourcepos="13265:1-13265:11"><code>&lt;style&gt;</code></li>
<li data-sourcepos="13266:1-13266:9"><code>&lt;xmp&gt;</code></li>
<li data-sourcepos="13267:1-13267:12"><code>&lt;iframe&gt;</code></li>
<li data-sourcepos="13268:1-13268:13"><code>&lt;noembed&gt;</code></li>
<li data-sourcepos="13269:1-13269:14"><code>&lt;noframes&gt;</code></li>
<li data-sourcepos="13270:1-13270:12"><code>&lt;script&gt;</code></li>
<li data-sourcepos="13271:1-13272:0"><code>&lt;plaintext&gt;</code></li>
2023-01-13 00:05:48 +05:30
</ul>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13273:1-13276:71">Filtering is done by replacing the leading <code>&lt;</code> with the entity <code>&amp;lt;</code>. These
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13278:1-13278:39">All other HTML tags are left untouched.</p>
<div>
<div><a href="#example-653">Example 653</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13283:1-13289:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;strong&gt; &lt;title&gt; &lt;style&gt; &lt;em&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC4" class="line" lang="plaintext"> &lt;xmp&gt; is disallowed. &lt;XMP&gt; is also disallowed.</span>
<span id="LC5" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13291:1-13296:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;strong&gt; &amp;lt;title&gt; &amp;lt;style&gt; &lt;em&gt;&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;blockquote&gt;</span>
<span id="LC3" class="line" lang="plaintext"> &amp;lt;xmp&gt; is disallowed. &amp;lt;XMP&gt; is also disallowed.</span>
<span id="LC4" class="line" lang="plaintext">&lt;/blockquote&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="13301:1-13301:19" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-hard-line-breaks" class="anchor" href="#hard-line-breaks" aria-hidden="true"></a>Hard line breaks</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13303:1-13306:27" dir="auto">A line break (not in a code span or HTML tag) that is preceded
2023-01-13 00:05:48 +05:30
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>&lt;br /&gt;</code> tag):</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-654">Example 654</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13311:1-13314:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13316:1-13319:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13323:1-13324:48" dir="auto">For a more visible alternative, a backslash before the
2023-01-13 00:05:48 +05:30
[line ending] may be used instead of two spaces:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-655">Example 655</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13329:1-13332:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13334:1-13337:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13341:1-13341:33" dir="auto">More than two spaces can be used:</p>
<div>
<div><a href="#example-656">Example 656</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13346:1-13349:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13351:1-13354:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13358:1-13358:61" dir="auto">Leading spaces at the beginning of the next line are ignored:</p>
<div>
<div><a href="#example-657">Example 657</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13363:1-13366:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13368:1-13371:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-658">Example 658</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13378:1-13381:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13383:1-13386:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13390:1-13391:26" dir="auto">Line breaks can occur inside emphasis, links, and other constructs
2023-01-13 00:05:48 +05:30
that allow inline content:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-659">Example 659</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13396:1-13399:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13401:1-13404:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-660">Example 660</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13411:1-13414:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13416:1-13419:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;em&gt;foo&lt;br /&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar&lt;/em&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13423:1-13423:42" dir="auto">Line breaks do not occur inside code spans</p>
<div>
<div><a href="#example-661">Example 661</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13428:1-13431:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13433:1-13435:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;code span&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-662">Example 662</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13442:1-13445:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13447:1-13449:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;code&gt;code\ span&lt;/code&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13453:1-13453:13" dir="auto">or HTML tags:</p>
<div>
<div><a href="#example-663">Example 663</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13458:1-13461:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="foo </span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar"&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13463:1-13466:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="foo </span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar"&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-664">Example 664</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13473:1-13476:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;a href="foo\</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar"&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13478:1-13481:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="foo\</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">bar"&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13485:1-13487:20" dir="auto">Hard line breaks are for separating inline content within a block.
2023-01-13 00:05:48 +05:30
Neither syntax for hard line breaks works at the end of a paragraph or
other block element:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-665">Example 665</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13492:1-13494:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13496:1-13498:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo\&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-666">Example 666</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13505:1-13507:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13509:1-13511:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-667">Example 667</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13518:1-13520:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13522:1-13524:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h3&gt;foo\&lt;/h3&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-668">Example 668</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13531:1-13533:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13535:1-13537:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;h3&gt;foo&lt;/h3&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="13541:1-13541:19" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-soft-line-breaks" class="anchor" href="#soft-line-breaks" aria-hidden="true"></a>Soft line breaks</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13543:1-13547:62" dir="auto">A regular line break (not in a code span or HTML tag) that is not
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-669">Example 669</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13552:1-13555:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13557:1-13560:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13564:1-13565:8" dir="auto">Spaces at the end of the line and beginning of the next line are
2023-01-13 00:05:48 +05:30
removed:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-670">Example 670</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13570:1-13573:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13575:1-13578:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;foo</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">baz&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13582:1-13583:25" dir="auto">A conforming parser may render a soft line break in HTML either as a
2023-01-13 00:05:48 +05:30
line break or as a space.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13585:1-13586:20" dir="auto">A renderer may also provide an option to render soft line breaks
2023-01-13 00:05:48 +05:30
as hard line breaks.</p>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="13588:1-13588:18" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-textual-content" class="anchor" href="#textual-content" aria-hidden="true"></a>Textual content</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13590:1-13591:35" dir="auto">Any characters not given an interpretation by the above rules will
2023-01-13 00:05:48 +05:30
be parsed as plain textual content.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-671">Example 671</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13596:1-13598:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13600:1-13602:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;hello $.;'there&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-672">Example 672</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13609:1-13611:32" lang="plaintext" 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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13613:1-13615:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Foo χρῆν&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13619:1-13619:39" dir="auto">Internal spaces are preserved verbatim:</p>
<div>
<div><a href="#example-673">Example 673</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13624:1-13626:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13628:1-13630:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;Multiple spaces&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h1 data-sourcepos="13634:1-13634:40" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-gitlab-official-specification-markdown" class="anchor" href="#gitlab-official-specification-markdown" aria-hidden="true"></a>GitLab Official Specification Markdown</h1>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13636:1-13639:104" dir="auto">Currently, only some of the GitLab-specific markdown features are
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13641:1-13642:69" dir="auto">There is currently only this single top-level heading, but the
2023-01-13 00:05:48 +05:30
examples may be split into multiple top-level headings in the future.</p>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="13644:1-13644:12" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-footnotes" class="anchor" href="#footnotes" aria-hidden="true"></a>Footnotes</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13646:1-13647:143" dir="auto">See
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-674">Example 674</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13652:1-13656:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13658:1-13678:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">footnote reference tag</span>
<span id="LC3" class="line" lang="plaintext">&lt;sup&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref&gt;</span>
<span id="LC5" class="line" lang="plaintext">1</span>
<span id="LC6" class="line" lang="plaintext">&lt;/a&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/sup&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/p&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;section data-footnotes&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;ol&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;li id="fn-fortytwo-42"&gt;</span>
<span id="LC12" class="line" lang="plaintext">&lt;p&gt;</span>
<span id="LC13" class="line" lang="plaintext">footnote text</span>
<span id="LC14" class="line" lang="plaintext">&lt;a href="#fnref-fortytwo-42" data-footnote-backref&gt;</span>
<span id="LC15" class="line" lang="plaintext">&lt;/a&gt;</span>
<span id="LC16" class="line" lang="plaintext">&lt;/p&gt;</span>
<span id="LC17" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC18" class="line" lang="plaintext">&lt;/ol&gt;</span>
<span id="LC19" class="line" lang="plaintext">&lt;/section&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="13681:1-13681:18" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-task-list-items" class="anchor" href="#task-list-items" aria-hidden="true"></a>Task list items</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13683:1-13684:117" dir="auto">See
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13686:1-13689:39" dir="auto">Task list items (checkboxes) are defined as a GitHub Flavored Markdown extension in a section above.
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13691:1-13691:85" dir="auto">Some of the behavior of task list items is implemented as client-side JavaScript/CSS.</p>
<p data-sourcepos="13693:1-13693:80" dir="auto">The following are some basic examples; more examples may be added in the future.</p>
<p data-sourcepos="13695:1-13695:16" dir="auto">Incomplete task:</p>
<div>
<div><a href="#example-675">Example 675</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13700:1-13702:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13704:1-13712:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;task-button/&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;input type="checkbox" disabled/&gt;</span>
<span id="LC5" class="line" lang="plaintext">incomplete</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13715:1-13715:15" dir="auto">Completed task:</p>
<div>
<div><a href="#example-676">Example 676</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13720:1-13722:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13724:1-13732:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;task-button/&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;input type="checkbox" checked disabled/&gt;</span>
<span id="LC5" class="line" lang="plaintext">completed</span>
<span id="LC6" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13735:1-13735:18" dir="auto">Inapplicable task:</p>
<div>
<div><a href="#example-677">Example 677</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13740:1-13742:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13744:1-13754:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;task-button/&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;input type="checkbox" data-inapplicable disabled&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;s&gt;</span>
<span id="LC6" class="line" lang="plaintext">inapplicable</span>
<span id="LC7" class="line" lang="plaintext">&lt;/s&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13757:1-13758:50" dir="auto">Inapplicable task in a "loose" list. Note that the <code>&lt;del&gt;</code> tag is not applied to the
2023-01-13 00:05:48 +05:30
loose text; it has strikethrough applied with CSS.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-678">Example 678</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13763:1-13767:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13769:1-13784:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;ul&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;li&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;p&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;task-button/&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;input type="checkbox" data-inapplicable disabled&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;s&gt;</span>
<span id="LC7" class="line" lang="plaintext">inapplicable</span>
<span id="LC8" class="line" lang="plaintext">&lt;/s&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;/p&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;p&gt;</span>
<span id="LC11" class="line" lang="plaintext">text in loose list</span>
<span id="LC12" class="line" lang="plaintext">&lt;/p&gt;</span>
<span id="LC13" class="line" lang="plaintext">&lt;/li&gt;</span>
<span id="LC14" class="line" lang="plaintext">&lt;/ul&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="13787:1-13787:15" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-front-matter" class="anchor" href="#front-matter" aria-hidden="true"></a>Front matter</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13789:1-13790:121" dir="auto">See
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13792:1-13793:95" dir="auto">Front matter is metadata included at the beginning of a Markdown document, preceding the content.
2023-01-13 00:05:48 +05:30
This data can be used by static site generators like Jekyll, Hugo, and many other applications.</p>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13795:1-13795:18" dir="auto">YAML front matter:</p>
<div>
<div><a href="#example-679">Example 679</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13800:1-13804:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13806:1-13812:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;code&gt;</span>
<span id="LC3" class="line" lang="plaintext">title: YAML front matter</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13815:1-13815:18" dir="auto">TOML front matter:</p>
<div>
<div><a href="#example-680">Example 680</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13820:1-13824:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13826:1-13832:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;code&gt;</span>
<span id="LC3" class="line" lang="plaintext">title: TOML front matter</span>
<span id="LC4" class="line" lang="plaintext">&lt;/code&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13835:1-13835:18" dir="auto">JSON front matter:</p>
<div>
<div><a href="#example-681">Example 681</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13840:1-13846:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13848:1-13856:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;pre&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;code&gt;</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">&lt;/code&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;/pre&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13859:1-13859:66" dir="auto">Front matter blocks should be inserted at the top of the document:</p>
<div>
<div><a href="#example-682">Example 682</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13864:1-13870:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13872:1-13876:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;text&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;hr&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;h2&gt;title: YAML front matter&lt;/h2&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13879:1-13879:74" dir="auto">Front matter block delimiters shouldnt be preceded by space characters:</p>
<div>
<div><a href="#example-683">Example 683</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13884:1-13888:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13890:1-13893:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;hr&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;h2&gt;title: YAML front matter&lt;/h2&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="13896:1-13896:20" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-table-of-contents" class="anchor" href="#table-of-contents" aria-hidden="true"></a>Table of contents</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13898:1-13900:46" dir="auto">See
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="13902:1-13906:23" dir="auto">NOTE: Because of this bug (<a href="https://gitlab.com/gitlab-org/gitlab/-/issues/359077" rel="nofollow noreferrer noopener" target="_blank">https://gitlab.com/gitlab-org/gitlab/-/issues/359077</a>),
we cannot actually include the <code>TOC</code> tag with single brackets in backticks
in this Markdown document, otherwise it would render a table of contents inline
right here. So, it's been switched to <code>[</code> + <code>TOC</code> + <code>]</code> instead. This can be reverted
once that bug is fixed.</p>
<p data-sourcepos="13908:1-13909:76" dir="auto">A table of contents is an unordered list that links to subheadings in the document.
Add either the <code>[[_TOC_]]</code> tag or the <code>[</code> + <code>TOC</code> + <code>]</code> tag on its own line.</p>
<div>
<div><a href="#example-684">Example 684</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13914:1-13920:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13922:1-13933:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;nav&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &lt;ul&gt;</span>
<span id="LC3" class="line" lang="plaintext"> &lt;li&gt;&lt;a href="#heading-1"&gt;Heading 1&lt;/a&gt;&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext"> &lt;ul&gt;</span>
<span id="LC5" class="line" lang="plaintext"> &lt;li&gt;&lt;a href="#heading-2"&gt;Heading 2&lt;/a&gt;&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext"> &lt;/ul&gt;</span>
<span id="LC7" class="line" lang="plaintext"> &lt;/ul&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/nav&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;h1&gt;Heading 1&lt;/h1&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;h2&gt;Heading 2&lt;/h2&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<div>
<div><a href="#example-685">Example 685</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13939:1-13945:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13947:1-13958:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;nav&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &lt;ul&gt;</span>
<span id="LC3" class="line" lang="plaintext"> &lt;li&gt;&lt;a href="#heading-1"&gt;Heading 1&lt;/a&gt;&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext"> &lt;ul&gt;</span>
<span id="LC5" class="line" lang="plaintext"> &lt;li&gt;&lt;a href="#heading-2"&gt;Heading 2&lt;/a&gt;&lt;/li&gt;</span>
<span id="LC6" class="line" lang="plaintext"> &lt;/ul&gt;</span>
<span id="LC7" class="line" lang="plaintext"> &lt;/ul&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;/nav&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;h1&gt;Heading 1&lt;/h1&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;h2&gt;Heading 2&lt;/h2&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13961:1-13962:5" dir="auto">A table of contents is a block element. It should preceded and followed by a blank
2023-01-13 00:05:48 +05:30
line.</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-686">Example 686</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13967:1-13973:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13975:1-13978:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;[[&lt;em&gt;TOC&lt;/em&gt;]]text&lt;/p&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext">&lt;p&gt;text[TOC]&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="13981:1-13981:60" dir="auto">A table of contents can be indented with up to three spaces.</p>
<div>
<div><a href="#example-687">Example 687</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13986:1-13990:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="13992:1-13999:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;nav&gt;</span>
2023-01-13 00:05:48 +05:30
<span id="LC2" class="line" lang="plaintext"> &lt;ul&gt;</span>
<span id="LC3" class="line" lang="plaintext"> &lt;li&gt;&lt;a href="#heading-1"&gt;Heading 1&lt;/a&gt;&lt;/li&gt;</span>
<span id="LC4" class="line" lang="plaintext"> &lt;/ul&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;/nav&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;h1&gt;Heading 1&lt;/h1&gt;</span></code></pre>
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h1 data-sourcepos="14002:1-14002:36" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-gitlab-internal-extension-markdown" class="anchor" href="#gitlab-internal-extension-markdown" aria-hidden="true"></a>GitLab Internal Extension Markdown</h1>
2023-03-04 22:38:38 +05:30
<h2 data-sourcepos="14004:1-14004:8" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-audio" class="anchor" href="#audio" aria-hidden="true"></a>Audio</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="14006:1-14007:107" dir="auto">See
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="14009:1-14011:63" dir="auto">GLFM renders image elements as an audio player as long as the resources file extension is
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-688">Example 688</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14016:1-14018:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14020:1-14022:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;audio src="audio.oga" title="audio title"&gt;&lt;/audio&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="14025:1-14025:41" dir="auto">Reference definitions work audio as well:</p>
<div>
<div><a href="#example-689">Example 689</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14030:1-14034:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14036:1-14038:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;audio src="audio.oga" title="audio title"&gt;&lt;/audio&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="14041:1-14041:8" dir="auto">
2023-01-13 00:05:48 +05:30
<a id="user-content-video" class="anchor" href="#video" aria-hidden="true"></a>Video</h2>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="14043:1-14044:109" dir="auto">See
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="14046:1-14048:64" dir="auto">GLFM renders image elements as a video player as long as the resources file extension is
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-690">Example 690</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14054:1-14056:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14058:1-14060:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;video src="video.m4v" title="video title"&gt;&lt;/video&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="14063:1-14063:41" dir="auto">Reference definitions work video as well:</p>
<div>
<div><a href="#example-691">Example 691</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14068:1-14072:32" lang="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>
2023-01-13 00:05:48 +05:30
<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">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14074:1-14076:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;video src="video.mov" title="video title"&gt;&lt;/video&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h2 data-sourcepos="14079:1-14079:41" dir="auto">
2023-01-13 00:05:48 +05:30
<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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="14081:1-14083:42" dir="auto">This section contains examples of all controllers which use <code>PreviewMarkdown</code> module
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<p data-sourcepos="14086:1-14086:75" dir="auto"><code>preview_markdown</code> exercising <code>groups</code> API endpoint and <code>UploadLinkFilter</code>:</p>
<div>
<div><a href="#example-692">Example 692</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14091:1-14093:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14095:1-14097:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="groups-test-file"&gt;groups-test-file&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="14100:1-14100:81" dir="auto"><code>preview_markdown</code> exercising <code>projects</code> API endpoint and <code>RepositoryLinkFilter</code>:</p>
<div>
<div><a href="#example-693">Example 693</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14105:1-14107:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14109:1-14111:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="projects-test-file"&gt;projects-test-file&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="14114:1-14114:83" dir="auto"><code>preview_markdown</code> exercising <code>projects</code> API endpoint and <code>SnippetReferenceFilter</code>:</p>
<div>
<div><a href="#example-694">Example 694</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14119:1-14121:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14123:1-14125:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;This project snippet ID reference IS filtered: $88888&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="14128:1-14131:50" dir="auto"><code>preview_markdown</code> exercising personal (non-project) <code>snippets</code> API endpoint. This is
2023-01-13 00:05:48 +05:30
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>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-695">Example 695</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14136:1-14138:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14140:1-14142:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;This personal snippet ID reference is not filtered: $99999&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="14145:1-14145:80" dir="auto"><code>preview_markdown</code> exercising project <code>wikis</code> API endpoint and <code>WikiLinkFilter</code>:</p>
<div>
<div><a href="#example-696">Example 696</a></div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14150:1-14152:32" lang="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>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14154:1-14156:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="project-wikis-test-file"&gt;project-wikis-test-file&lt;/a&gt;&lt;/p&gt;</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<p data-sourcepos="14159:1-14160:63" dir="auto"><code>preview_markdown</code> exercising group <code>wikis</code> API endpoint and <code>WikiLinkFilter</code>. This example
2023-01-13 00:05:48 +05:30
also requires an EE license enabling the <code>group_wikis</code> feature:</p>
2023-03-04 22:38:38 +05:30
<div>
<div><a href="#example-697">Example 697</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14165:1-14167:32" lang="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="14169:1-14171:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;a href="group-wikis-test-file"&gt;group-wikis-test-file&lt;/a&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h2 data-sourcepos="14174:1-14174:34" dir="auto">
<a id="user-content-migrated-golden-master-examples" class="anchor" href="#migrated-golden-master-examples" aria-hidden="true"></a>Migrated golden master examples</h2>
<h3 data-sourcepos="14176:1-14176:30" dir="auto">
<a id="user-content-attachment_image_for_group" class="anchor" href="#attachment_image_for_group" aria-hidden="true"></a>attachment_image_for_group</h3>
<div>
<div><a href="#example-698">Example 698</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14181:1-14183:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14185:1-14187:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14190:1-14190:32" dir="auto">
<a id="user-content-attachment_image_for_project" class="anchor" href="#attachment_image_for_project" aria-hidden="true"></a>attachment_image_for_project</h3>
<div>
<div><a href="#example-699">Example 699</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14195:1-14197:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14199:1-14201:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14204:1-14204:37" dir="auto">
<a id="user-content-attachment_image_for_project_wiki" class="anchor" href="#attachment_image_for_project_wiki" aria-hidden="true"></a>attachment_image_for_project_wiki</h3>
<div>
<div><a href="#example-700">Example 700</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14209:1-14211:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![test-file](test-file.png)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14213:1-14215:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14218:1-14218:29" dir="auto">
<a id="user-content-attachment_link_for_group" class="anchor" href="#attachment_link_for_group" aria-hidden="true"></a>attachment_link_for_group</h3>
<div>
<div><a href="#example-701">Example 701</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14223:1-14225:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14227:1-14229:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14232:1-14232:31" dir="auto">
<a id="user-content-attachment_link_for_project" class="anchor" href="#attachment_link_for_project" aria-hidden="true"></a>attachment_link_for_project</h3>
<div>
<div><a href="#example-702">Example 702</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14237:1-14239:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14241:1-14243:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14246:1-14246:36" dir="auto">
<a id="user-content-attachment_link_for_project_wiki" class="anchor" href="#attachment_link_for_project_wiki" aria-hidden="true"></a>attachment_link_for_project_wiki</h3>
<div>
<div><a href="#example-703">Example 703</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14251:1-14253:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[test-file](test-file.zip)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14255:1-14257:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14260:1-14260:34" dir="auto">
<a id="user-content-attachment_link_for_group_wiki" class="anchor" href="#attachment_link_for_group_wiki" aria-hidden="true"></a>attachment_link_for_group_wiki</h3>
<div>
<div><a href="#example-704">Example 704</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14265:1-14267:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[test-file](test-file.zip)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14269:1-14271:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14274:1-14274:9" dir="auto">
<a id="user-content-audio-1" class="anchor" href="#audio-1" aria-hidden="true"></a>audio</h3>
<div>
<div><a href="#example-705">Example 705</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14279:1-14281:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![Sample Audio](https://gitlab.com/gitlab.mp3)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14283:1-14285:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14288:1-14288:28" dir="auto">
<a id="user-content-audio_and_video_in_lists" class="anchor" href="#audio_and_video_in_lists" aria-hidden="true"></a>audio_and_video_in_lists</h3>
<div>
<div><a href="#example-706">Example 706</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14293:1-14303:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* ![Sample Audio](https://gitlab.com/1.mp3)</span>
<span id="LC2" class="line" lang="plaintext">* ![Sample Video](https://gitlab.com/2.mp4)</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext">1. ![Sample Video](https://gitlab.com/1.mp4)</span>
<span id="LC5" class="line" lang="plaintext">2. ![Sample Audio](https://gitlab.com/2.mp3)</span>
<span id="LC6" class="line" lang="plaintext"></span>
<span id="LC7" class="line" lang="plaintext">* [x] ![Sample Audio](https://gitlab.com/1.mp3)</span>
<span id="LC8" class="line" lang="plaintext">* [x] ![Sample Audio](https://gitlab.com/2.mp3)</span>
<span id="LC9" class="line" lang="plaintext">* [x] ![Sample Video](https://gitlab.com/3.mp4)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14305:1-14307:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14310:1-14310:14" dir="auto">
<a id="user-content-blockquote" class="anchor" href="#blockquote" aria-hidden="true"></a>blockquote</h3>
<div>
<div><a href="#example-707">Example 707</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14315:1-14319:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&gt; This is a blockquote</span>
<span id="LC2" class="line" lang="plaintext">&gt;</span>
<span id="LC3" class="line" lang="plaintext">&gt; This is another one</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14321:1-14323:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14326:1-14326:8" dir="auto">
<a id="user-content-bold" class="anchor" href="#bold" aria-hidden="true"></a>bold</h3>
<div>
<div><a href="#example-708">Example 708</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14331:1-14333:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**bold**</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14335:1-14337:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14340:1-14340:23" dir="auto">
<a id="user-content-bullet_list_style_1" class="anchor" href="#bullet_list_style_1" aria-hidden="true"></a>bullet_list_style_1</h3>
<div>
<div><a href="#example-709">Example 709</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14345:1-14349:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* list item 1</span>
<span id="LC2" class="line" lang="plaintext">* list item 2</span>
<span id="LC3" class="line" lang="plaintext"> * embedded list item 3</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14351:1-14353:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14356:1-14356:23" dir="auto">
<a id="user-content-bullet_list_style_2" class="anchor" href="#bullet_list_style_2" aria-hidden="true"></a>bullet_list_style_2</h3>
<div>
<div><a href="#example-710">Example 710</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14361:1-14365:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- list item 1</span>
<span id="LC2" class="line" lang="plaintext">- list item 2</span>
<span id="LC3" class="line" lang="plaintext"> * embedded list item 3</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14367:1-14369:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14372:1-14372:23" dir="auto">
<a id="user-content-bullet_list_style_3" class="anchor" href="#bullet_list_style_3" aria-hidden="true"></a>bullet_list_style_3</h3>
<div>
<div><a href="#example-711">Example 711</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14377:1-14381:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+ list item 1</span>
<span id="LC2" class="line" lang="plaintext">+ list item 2</span>
<span id="LC3" class="line" lang="plaintext"> - embedded list item 3</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14383:1-14385:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14388:1-14388:25" dir="auto">
<a id="user-content-code_block_javascript" class="anchor" href="#code_block_javascript" aria-hidden="true"></a>code_block_javascript</h3>
<div>
<div><a href="#example-712">Example 712</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14393:1-14397:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```javascript</span>
<span id="LC2" class="line" lang="plaintext"> console.log('hello world')</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="14399:1-14401:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14404:1-14404:24" dir="auto">
<a id="user-content-code_block_plaintext" class="anchor" href="#code_block_plaintext" aria-hidden="true"></a>code_block_plaintext</h3>
<div>
<div><a href="#example-713">Example 713</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14409:1-14413:32" lang="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"> 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="14415:1-14417:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14420:1-14420:22" dir="auto">
<a id="user-content-code_block_unknown" class="anchor" href="#code_block_unknown" aria-hidden="true"></a>code_block_unknown</h3>
<div>
<div><a href="#example-714">Example 714</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14425:1-14429:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```foobar</span>
<span id="LC2" class="line" lang="plaintext"> custom_language = &gt;&gt; this &lt;&lt;</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="14431:1-14433:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14436:1-14436:15" dir="auto">
<a id="user-content-color_chips" class="anchor" href="#color_chips" aria-hidden="true"></a>color_chips</h3>
<div>
<div><a href="#example-715">Example 715</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14441:1-14451:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- `#F00`</span>
<span id="LC2" class="line" lang="plaintext">- `#F00A`</span>
<span id="LC3" class="line" lang="plaintext">- `#FF0000`</span>
<span id="LC4" class="line" lang="plaintext">- `#FF0000AA`</span>
<span id="LC5" class="line" lang="plaintext">- `RGB(0,255,0)`</span>
<span id="LC6" class="line" lang="plaintext">- `RGB(0%,100%,0%)`</span>
<span id="LC7" class="line" lang="plaintext">- `RGBA(0,255,0,0.3)`</span>
<span id="LC8" class="line" lang="plaintext">- `HSL(540,70%,50%)`</span>
<span id="LC9" class="line" lang="plaintext">- `HSLA(540,70%,50%,0.3)`</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14453:1-14455:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14458:1-14458:20" dir="auto">
<a id="user-content-description_list" class="anchor" href="#description_list" aria-hidden="true"></a>description_list</h3>
<div>
<div><a href="#example-716">Example 716</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14463:1-14480:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;dl&gt;</span>
<span id="LC2" class="line" lang="plaintext">&lt;dt&gt;Frog&lt;/dt&gt;</span>
<span id="LC3" class="line" lang="plaintext">&lt;dd&gt;Wet green thing&lt;/dd&gt;</span>
<span id="LC4" class="line" lang="plaintext">&lt;dt&gt;Rabbit&lt;/dt&gt;</span>
<span id="LC5" class="line" lang="plaintext">&lt;dd&gt;Warm fluffy thing&lt;/dd&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;dt&gt;Punt&lt;/dt&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;dd&gt;Kick a ball&lt;/dd&gt;</span>
<span id="LC8" class="line" lang="plaintext">&lt;dd&gt;Take a bet&lt;/dd&gt;</span>
<span id="LC9" class="line" lang="plaintext">&lt;dt&gt;Color&lt;/dt&gt;</span>
<span id="LC10" class="line" lang="plaintext">&lt;dt&gt;Colour&lt;/dt&gt;</span>
<span id="LC11" class="line" lang="plaintext">&lt;dd&gt;</span>
<span id="LC12" class="line" lang="plaintext"></span>
<span id="LC13" class="line" lang="plaintext">Any hue except _white_ or **black**</span>
<span id="LC14" class="line" lang="plaintext"></span>
<span id="LC15" class="line" lang="plaintext">&lt;/dd&gt;</span>
<span id="LC16" class="line" lang="plaintext">&lt;/dl&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14482:1-14484:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14487:1-14487:11" dir="auto">
<a id="user-content-details" class="anchor" href="#details" aria-hidden="true"></a>details</h3>
<div>
<div><a href="#example-717">Example 717</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14492:1-14500:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;details&gt;</span>
<span id="LC2" class="line" lang="plaintext">&lt;summary&gt;This is the visible summary of the collapsible section&lt;/summary&gt;</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext">1. collapsed markdown</span>
<span id="LC5" class="line" lang="plaintext">2. more collapsed markdown</span>
<span id="LC6" class="line" lang="plaintext"></span>
<span id="LC7" class="line" lang="plaintext">&lt;/details&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14502:1-14504:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14507:1-14507:25" dir="auto">
<a id="user-content-diagram_kroki_nomnoml" class="anchor" href="#diagram_kroki_nomnoml" aria-hidden="true"></a>diagram_kroki_nomnoml</h3>
<div>
<div><a href="#example-718">Example 718</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14512:1-14524:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```nomnoml</span>
<span id="LC2" class="line" lang="plaintext"> #stroke: #a86128</span>
<span id="LC3" class="line" lang="plaintext"> [&lt;frame&gt;Decorator pattern|</span>
<span id="LC4" class="line" lang="plaintext"> [&lt;abstract&gt;Component||+ operation()]</span>
<span id="LC5" class="line" lang="plaintext"> [Client] depends --&gt; [Component]</span>
<span id="LC6" class="line" lang="plaintext"> [Decorator|- next: Component]</span>
<span id="LC7" class="line" lang="plaintext"> [Decorator] decorates -- [ConcreteComponent]</span>
<span id="LC8" class="line" lang="plaintext"> [Component] &lt;:- [Decorator]</span>
<span id="LC9" class="line" lang="plaintext"> [Component] &lt;:- [ConcreteComponent]</span>
<span id="LC10" class="line" lang="plaintext"> ]</span>
<span id="LC11" 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="14526:1-14528:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14531:1-14531:20" dir="auto">
<a id="user-content-diagram_plantuml" class="anchor" href="#diagram_plantuml" aria-hidden="true"></a>diagram_plantuml</h3>
<div>
<div><a href="#example-719">Example 719</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14536:1-14544:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```plantuml</span>
<span id="LC2" class="line" lang="plaintext"> Alice -&gt; Bob: Authentication Request</span>
<span id="LC3" class="line" lang="plaintext"> Bob --&gt; Alice: Authentication Response</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext"> Alice -&gt; Bob: Another authentication Request</span>
<span id="LC6" class="line" lang="plaintext"> Alice &lt;-- Bob: Another authentication Response</span>
<span id="LC7" 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="14546:1-14548:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14551:1-14551:28" dir="auto">
<a id="user-content-diagram_plantuml_unicode" class="anchor" href="#diagram_plantuml_unicode" aria-hidden="true"></a>diagram_plantuml_unicode</h3>
<div>
<div><a href="#example-720">Example 720</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14556:1-14560:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```plantuml</span>
<span id="LC2" class="line" lang="plaintext">A -&gt; B : Text with norwegian characters: æøå</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="14562:1-14564:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14567:1-14567:7" dir="auto">
<a id="user-content-div" class="anchor" href="#div" aria-hidden="true"></a>div</h3>
<div>
<div><a href="#example-721">Example 721</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14572:1-14579:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;div&gt;plain text&lt;/div&gt;</span>
<span id="LC2" class="line" lang="plaintext">&lt;div&gt;</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext">just a plain ol' div, not much to _expect_!</span>
<span id="LC5" class="line" lang="plaintext"></span>
<span id="LC6" class="line" lang="plaintext">&lt;/div&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14581:1-14583:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14586:1-14586:9" dir="auto">
<a id="user-content-emoji" class="anchor" href="#emoji" aria-hidden="true"></a>emoji</h3>
<div>
<div><a href="#example-722">Example 722</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14591:1-14593:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">:sparkles: :heart: :100:</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14595:1-14597:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14600:1-14600:12" dir="auto">
<a id="user-content-emphasis" class="anchor" href="#emphasis" aria-hidden="true"></a>emphasis</h3>
<div>
<div><a href="#example-723">Example 723</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14605:1-14607:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_emphasized text_</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14609:1-14611:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14614:1-14614:10" dir="auto">
<a id="user-content-figure" class="anchor" href="#figure" aria-hidden="true"></a>figure</h3>
<div>
<div><a href="#example-724">Example 724</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14619:1-14636:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;figure&gt;</span>
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">![Elephant at sunset](elephant-sunset.jpg)</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">&lt;figcaption&gt;An elephant at sunset&lt;/figcaption&gt;</span>
<span id="LC6" class="line" lang="plaintext">&lt;/figure&gt;</span>
<span id="LC7" class="line" lang="plaintext">&lt;figure&gt;</span>
<span id="LC8" class="line" lang="plaintext"></span>
<span id="LC9" class="line" lang="plaintext">![A crocodile wearing crocs](croc-crocs.jpg)</span>
<span id="LC10" class="line" lang="plaintext"></span>
<span id="LC11" class="line" lang="plaintext">&lt;figcaption&gt;</span>
<span id="LC12" class="line" lang="plaintext"></span>
<span id="LC13" class="line" lang="plaintext">A crocodile wearing _crocs_!</span>
<span id="LC14" class="line" lang="plaintext"></span>
<span id="LC15" class="line" lang="plaintext">&lt;/figcaption&gt;</span>
<span id="LC16" class="line" lang="plaintext">&lt;/figure&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14638:1-14640:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14643:1-14643:13" dir="auto">
<a id="user-content-footnotes-1" class="anchor" href="#footnotes-1" aria-hidden="true"></a>footnotes</h3>
<div>
<div><a href="#example-725">Example 725</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14648:1-14656:32" lang="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 footnote reference tag looks like this: [^1]</span>
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">This reference tag is a mix of letters and numbers. [^footnote]</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">[^1]: This is the text inside a footnote.</span>
<span id="LC6" class="line" lang="plaintext"></span>
<span id="LC7" class="line" lang="plaintext">[^footnote]: This is another footnote.</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14658:1-14660:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14663:1-14663:20" dir="auto">
<a id="user-content-frontmatter_json" class="anchor" href="#frontmatter_json" aria-hidden="true"></a>frontmatter_json</h3>
<div>
<div><a href="#example-726">Example 726</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14668:1-14674:32" lang="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": "Page title"</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="14676:1-14678:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14681:1-14681:20" dir="auto">
<a id="user-content-frontmatter_toml" class="anchor" href="#frontmatter_toml" aria-hidden="true"></a>frontmatter_toml</h3>
<div>
<div><a href="#example-727">Example 727</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14686:1-14690:32" lang="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 = "Page title"</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="14692:1-14694:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14697:1-14697:20" dir="auto">
<a id="user-content-frontmatter_yaml" class="anchor" href="#frontmatter_yaml" aria-hidden="true"></a>frontmatter_yaml</h3>
<div>
<div><a href="#example-728">Example 728</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14702:1-14706:32" lang="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: Page title</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="14708:1-14710:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14713:1-14713:14" dir="auto">
<a id="user-content-hard_break" class="anchor" href="#hard_break" aria-hidden="true"></a>hard_break</h3>
<div>
<div><a href="#example-729">Example 729</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14718:1-14721:32" lang="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 is a line after a\</span>
<span id="LC2" class="line" lang="plaintext">hard break</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14723:1-14725:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14728:1-14728:12" dir="auto">
<a id="user-content-headings" class="anchor" href="#headings" aria-hidden="true"></a>headings</h3>
<div>
<div><a href="#example-730">Example 730</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14733:1-14745:32" lang="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 1</span>
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">## Heading 2</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">### Heading 3</span>
<span id="LC6" class="line" lang="plaintext"></span>
<span id="LC7" class="line" lang="plaintext">#### Heading 4</span>
<span id="LC8" class="line" lang="plaintext"></span>
<span id="LC9" class="line" lang="plaintext">##### Heading 5</span>
<span id="LC10" class="line" lang="plaintext"></span>
<span id="LC11" class="line" lang="plaintext">###### Heading 6</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14747:1-14749:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14752:1-14752:19" dir="auto">
<a id="user-content-horizontal_rule" class="anchor" href="#horizontal_rule" aria-hidden="true"></a>horizontal_rule</h3>
<div>
<div><a href="#example-731">Example 731</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14757:1-14759:32" lang="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="14761:1-14763:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14766:1-14766:14" dir="auto">
<a id="user-content-html_marks" class="anchor" href="#html_marks" aria-hidden="true"></a>html_marks</h3>
<div>
<div><a href="#example-732">Example 732</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14771:1-14787:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* Content editor is ~~great~~&lt;ins&gt;amazing&lt;/ins&gt;.</span>
<span id="LC2" class="line" lang="plaintext">* If the changes &lt;abbr title="Looks good to merge"&gt;LGTM&lt;/abbr&gt;, please &lt;abbr title="Merge when pipeline succeeds"&gt;MWPS&lt;/abbr&gt;.</span>
<span id="LC3" class="line" lang="plaintext">* The English song &lt;q&gt;Oh I do like to be beside the seaside&lt;/q&gt; looks like this in Hebrew: &lt;span dir="rtl"&gt;אה, אני אוהב להיות ליד חוף הים&lt;/span&gt;. In the computer's memory, this is stored as &lt;bdo dir="ltr"&gt;אה, אני אוהב להיות ליד חוף הים&lt;/bdo&gt;.</span>
<span id="LC4" class="line" lang="plaintext">* &lt;cite&gt;The Scream&lt;/cite&gt; by Edvard Munch. Painted in 1893.</span>
<span id="LC5" class="line" lang="plaintext">* &lt;dfn&gt;HTML&lt;/dfn&gt; is the standard markup language for creating web pages.</span>
<span id="LC6" class="line" lang="plaintext">* Do not forget to buy &lt;mark&gt;milk&lt;/mark&gt; today.</span>
<span id="LC7" class="line" lang="plaintext">* This is a paragraph and &lt;small&gt;smaller text goes here&lt;/small&gt;.</span>
<span id="LC8" class="line" lang="plaintext">* The concert starts at &lt;time datetime="20:00"&gt;20:00&lt;/time&gt; and you'll be able to enjoy the band for at least &lt;time datetime="PT2H30M"&gt;2h 30m&lt;/time&gt;.</span>
<span id="LC9" class="line" lang="plaintext">* Press &lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;C&lt;/kbd&gt; to copy text (Windows).</span>
<span id="LC10" class="line" lang="plaintext">* WWF's goal is to: &lt;q&gt;Build a future where people live in harmony with nature.&lt;/q&gt; We hope they succeed.</span>
<span id="LC11" class="line" lang="plaintext">* The error occurred was: &lt;samp&gt;Keyboard not found. Press F1 to continue.&lt;/samp&gt;</span>
<span id="LC12" class="line" lang="plaintext">* The area of a triangle is: 1/2 x &lt;var&gt;b&lt;/var&gt; x &lt;var&gt;h&lt;/var&gt;, where &lt;var&gt;b&lt;/var&gt; is the base, and &lt;var&gt;h&lt;/var&gt; is the vertical height.</span>
<span id="LC13" class="line" lang="plaintext">* &lt;ruby&gt;&lt;rt&gt;ㄏㄢˋ&lt;/rt&gt;&lt;/ruby&gt;</span>
<span id="LC14" class="line" lang="plaintext">* C&lt;sub&gt;7&lt;/sub&gt;H&lt;sub&gt;16&lt;/sub&gt; + O&lt;sub&gt;2&lt;/sub&gt; → CO&lt;sub&gt;2&lt;/sub&gt; + H&lt;sub&gt;2&lt;/sub&gt;O</span>
<span id="LC15" class="line" lang="plaintext">* The **Pythagorean theorem** is often expressed as &lt;var&gt;a&lt;sup&gt;2&lt;/sup&gt;&lt;/var&gt; + &lt;var&gt;b&lt;sup&gt;2&lt;/sup&gt;&lt;/var&gt; = &lt;var&gt;c&lt;sup&gt;2&lt;/sup&gt;&lt;/var&gt;</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14789:1-14791:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14794:1-14794:9" dir="auto">
<a id="user-content-image" class="anchor" href="#image" aria-hidden="true"></a>image</h3>
<div>
<div><a href="#example-733">Example 733</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14799:1-14801:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![alt text](https://gitlab.com/logo.png)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14803:1-14805:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14808:1-14808:15" dir="auto">
<a id="user-content-inline_code" class="anchor" href="#inline_code" aria-hidden="true"></a>inline_code</h3>
<div>
<div><a href="#example-734">Example 734</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14813:1-14815:32" lang="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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14817:1-14819:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14822:1-14822:15" dir="auto">
<a id="user-content-inline_diff" class="anchor" href="#inline_diff" aria-hidden="true"></a>inline_diff</h3>
<div>
<div><a href="#example-735">Example 735</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14827:1-14830:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* {-deleted-}</span>
<span id="LC2" class="line" lang="plaintext">* {+added+}</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14832:1-14834:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14837:1-14837:9" dir="auto">
<a id="user-content-label" class="anchor" href="#label" aria-hidden="true"></a>label</h3>
<div>
<div><a href="#example-736">Example 736</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14842:1-14844:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~bug</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14846:1-14848:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14851:1-14851:8" dir="auto">
<a id="user-content-link" class="anchor" href="#link" aria-hidden="true"></a>link</h3>
<div>
<div><a href="#example-737">Example 737</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14856:1-14858:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[GitLab](https://gitlab.com)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14860:1-14862:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14865:1-14865:8" dir="auto">
<a id="user-content-math" class="anchor" href="#math" aria-hidden="true"></a>math</h3>
<div>
<div><a href="#example-738">Example 738</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14870:1-14878:32" lang="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 math is inline $`a^2+b^2=c^2`$.</span>
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">This is on a separate line:</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">```math</span>
<span id="LC6" class="line" lang="plaintext">a^2+b^2=c^2</span>
<span id="LC7" 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="14880:1-14882:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14885:1-14885:16" dir="auto">
<a id="user-content-ordered_list" class="anchor" href="#ordered_list" aria-hidden="true"></a>ordered_list</h3>
<div>
<div><a href="#example-739">Example 739</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14890:1-14894:32" lang="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. list item 1</span>
<span id="LC2" class="line" lang="plaintext">2. list item 2</span>
<span id="LC3" class="line" lang="plaintext">3. list item 3</span></code></pre>
<copy-code></copy-code>
</div>
2023-01-13 00:05:48 +05:30
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14896:1-14898:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14901:1-14901:33" dir="auto">
<a id="user-content-ordered_list_with_start_order" class="anchor" href="#ordered_list_with_start_order" aria-hidden="true"></a>ordered_list_with_start_order</h3>
<div>
<div><a href="#example-740">Example 740</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14906:1-14910:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">134. list item 1</span>
<span id="LC2" class="line" lang="plaintext">135. list item 2</span>
<span id="LC3" class="line" lang="plaintext">136. list item 3</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14912:1-14914:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14917:1-14917:21" dir="auto">
<a id="user-content-ordered_task_list" class="anchor" href="#ordered_task_list" aria-hidden="true"></a>ordered_task_list</h3>
<div>
<div><a href="#example-741">Example 741</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14922:1-14929:32" lang="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. [x] hello</span>
<span id="LC2" class="line" lang="plaintext">2. [x] world</span>
<span id="LC3" class="line" lang="plaintext">3. [ ] example</span>
<span id="LC4" class="line" lang="plaintext"> 1. [ ] of nested</span>
<span id="LC5" class="line" lang="plaintext"> 1. [x] task list</span>
<span id="LC6" class="line" lang="plaintext"> 2. [ ] items</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14931:1-14933:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14936:1-14936:32" dir="auto">
<a id="user-content-ordered_task_list_with_order" class="anchor" href="#ordered_task_list_with_order" aria-hidden="true"></a>ordered_task_list_with_order</h3>
<div>
<div><a href="#example-742">Example 742</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14941:1-14945:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">4893. [x] hello</span>
<span id="LC2" class="line" lang="plaintext">4894. [x] world</span>
<span id="LC3" class="line" lang="plaintext">4895. [ ] example</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14947:1-14949:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14952:1-14952:30" dir="auto">
<a id="user-content-reference_for_project_wiki" class="anchor" href="#reference_for_project_wiki" aria-hidden="true"></a>reference_for_project_wiki</h3>
<div>
<div><a href="#example-743">Example 743</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14957:1-14959:32" lang="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 @gfm_user - thank you for reporting this ~"UX bug" (#1) we hope to fix it in %1.1 as part of !1</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
2023-03-04 22:38:38 +05:30
<pre data-sourcepos="14961:1-14963:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
2023-01-13 00:05:48 +05:30
<copy-code></copy-code>
</div>
2023-03-04 22:38:38 +05:30
</div>
<h3 data-sourcepos="14966:1-14966:10" dir="auto">
<a id="user-content-strike" class="anchor" href="#strike" aria-hidden="true"></a>strike</h3>
<div>
<div><a href="#example-744">Example 744</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14971:1-14973:32" lang="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></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14975:1-14977:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14980:1-14980:9" dir="auto">
<a id="user-content-table" class="anchor" href="#table" aria-hidden="true"></a>table</h3>
<div>
<div><a href="#example-745">Example 745</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14985:1-14992:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| header | header |</span>
<span id="LC2" class="line" lang="plaintext">|--------|--------|</span>
<span id="LC3" class="line" lang="plaintext">| `code` | cell with **bold** |</span>
<span id="LC4" class="line" lang="plaintext">| ~~strike~~ | cell with _italic_ |</span>
<span id="LC5" class="line" lang="plaintext"></span>
<span id="LC6" class="line" lang="plaintext"># content after table</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="14994:1-14996:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="14999:1-14999:21" dir="auto">
<a id="user-content-table_of_contents" class="anchor" href="#table_of_contents" aria-hidden="true"></a>table_of_contents</h3>
<div>
<div><a href="#example-746">Example 746</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15004:1-15018:32" lang="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"># Lorem</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext">Well, that's just like... your opinion.. man.</span>
<span id="LC6" class="line" lang="plaintext"></span>
<span id="LC7" class="line" lang="plaintext">## Ipsum</span>
<span id="LC8" class="line" lang="plaintext"></span>
<span id="LC9" class="line" lang="plaintext">### Dolar</span>
<span id="LC10" class="line" lang="plaintext"></span>
<span id="LC11" class="line" lang="plaintext"># Sit amit</span>
<span id="LC12" class="line" lang="plaintext"></span>
<span id="LC13" class="line" lang="plaintext">### I don't know</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15020:1-15022:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="15025:1-15025:13" dir="auto">
<a id="user-content-task_list" class="anchor" href="#task_list" aria-hidden="true"></a>task_list</h3>
<div>
<div><a href="#example-747">Example 747</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15030:1-15037:32" lang="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] hello</span>
<span id="LC2" class="line" lang="plaintext">* [x] world</span>
<span id="LC3" class="line" lang="plaintext">* [ ] example</span>
<span id="LC4" class="line" lang="plaintext"> * [ ] of nested</span>
<span id="LC5" class="line" lang="plaintext"> * [x] task list</span>
<span id="LC6" class="line" lang="plaintext"> * [ ] items</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15039:1-15041:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="15044:1-15044:9" dir="auto">
<a id="user-content-video-1" class="anchor" href="#video-1" aria-hidden="true"></a>video</h3>
<div>
<div><a href="#example-748">Example 748</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15049:1-15051:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![Sample Video](https://gitlab.com/gitlab.mp4)</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15053:1-15055:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h3 data-sourcepos="15058:1-15058:14" dir="auto">
<a id="user-content-word_break" class="anchor" href="#word_break" aria-hidden="true"></a>word_break</h3>
<div>
<div><a href="#example-749">Example 749</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15063:1-15065:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Fernstraßen&lt;wbr&gt;bau&lt;wbr&gt;privat&lt;wbr&gt;finanzierungs&lt;wbr&gt;gesetz</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15067:1-15069:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<h2 data-sourcepos="15072:1-15072:19" dir="auto">
<a id="user-content-image-attributes" class="anchor" href="#image-attributes" aria-hidden="true"></a>Image Attributes</h2>
<p data-sourcepos="15074:1-15076:46" dir="auto">See
<a href="https://docs.gitlab.com/ee/user/markdown.html#change-the-image-dimensions" rel="nofollow noreferrer noopener" target="_blank">Change the image dimensions</a>
in the GitLab Flavored Markdown documentation.</p>
<p data-sourcepos="15078:1-15079:19" dir="auto">The <code>width</code> and <code>height</code> attributes for an image can be specified directly after
the image markdown.</p>
<p data-sourcepos="15081:1-15083:21" dir="auto">General syntax conforms to the
<a href="https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/attributes.md" rel="nofollow noreferrer noopener" target="_blank">commonmark-hs attribute syntax</a>
where it makes sense.</p>
<div>
<div><a href="#example-750">Example 750</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15088:1-15090:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![](https://gitlab.com/logo.png){width="100" height="100"}</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15092:1-15094:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="https://gitlab.com/logo.png" width="100" height="100"&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<p data-sourcepos="15097:1-15097:41" dir="auto"><code>%</code> and <code>px</code> units may also be specified.</p>
<div>
<div><a href="#example-751">Example 751</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15102:1-15104:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![](https://gitlab.com/logo.png){width="100%"}</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15106:1-15108:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="https://gitlab.com/logo.png" width="100%"&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<div>
<div><a href="#example-752">Example 752</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15114:1-15116:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![](https://gitlab.com/logo.png){height="100px"}</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15118:1-15120:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="https://gitlab.com/logo.png" height="100px"&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<p data-sourcepos="15123:1-15123:46" dir="auto">Whitespace is tolerated around the delimiters:</p>
<div>
<div><a href="#example-753">Example 753</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15128:1-15130:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![](https://gitlab.com/logo.png){ width="100" height="100" }</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15132:1-15134:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="https://gitlab.com/logo.png" width="100" height="100"&gt;&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
<p data-sourcepos="15137:1-15137:54" dir="auto">Attributes must immediately follow the image markdown.</p>
<div>
<div><a href="#example-754">Example 754</a></div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15142:1-15144:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![](https://gitlab.com/logo.png) {width="100" height="100"}</span></code></pre>
<copy-code></copy-code>
</div>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre data-sourcepos="15146:1-15148:32" lang="plaintext" class="code highlight js-syntax-highlight language-plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&lt;p&gt;&lt;img src="https://gitlab.com/logo.png"&gt; {width="100" height="100"}&lt;/p&gt;</span></code></pre>
<copy-code></copy-code>
</div>
</div>
</body>
</html>