2.2Tabs

Tabs in lines are not expanded to spaces. However, in contexts where spaces help to define block structure, tabs behave as if they were replaced by spaces with a tab stop of 4 characters.

Thus, for example, a tab can be used instead of four spaces in an indented code block. (Note, however, that internal tabs are passed through as literal tabs, not expanded to spaces.)

Example 1Try It
→foo→baz→→bim
<pre><code>foo→baz→→bim
</code></pre>
Example 2Try It
  →foo→baz→→bim
<pre><code>foo→baz→→bim
</code></pre>
Example 3Try It
    a→a
    ὐ→a
<pre><code>a→a
ὐ→a
</code></pre>

In the following example, a continuation paragraph of a list item is indented with a tab; this has exactly the same effect as indentation with four spaces would:

Example 4Try It
  - foo

→bar
<ul>
<li>
<p>foo</p>
<p>bar</p>
</li>
</ul>
Example 5Try It
- foo

→→bar
<ul>
<li>
<p>foo</p>
<pre><code>  bar
</code></pre>
</li>
</ul>

Normally the > that begins a block quote may be followed optionally by a space, which is not considered part of the content. In the following case > 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, foo is considered to be indented six spaces inside the block quote context, so we get an indented code block starting with two spaces.

Example 6Try It
>→→foo
<blockquote>
<pre><code>  foo
</code></pre>
</blockquote>
Example 7Try It
-→→foo
<ul>
<li>
<pre><code>  foo
</code></pre>
</li>
</ul>
Example 8Try It
    foo
→bar
<pre><code>foo
bar
</code></pre>
Example 9Try It
 - foo
   - bar
→ - baz
<ul>
<li>foo
<ul>
<li>bar
<ul>
<li>baz</li>
</ul>
</li>
</ul>
</li>
</ul>
Example 10Try It
#→Foo
<h1>Foo</h1>
Example 11Try It
*→*→*→
<hr />

2.3Insecure characters

For security reasons, the Unicode character U+0000 must be replaced with the REPLACEMENT CHARACTER (U+FFFD).