aboutsummaryrefslogtreecommitdiff
path: root/spec.txt
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-06-27 15:16:33 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2016-06-27 15:16:33 -0700
commitee75eb33f9bdf6901388e5f9175834acca814e5c (patch)
treeabe2bb3d8d1c3bb22d1ec784894f9377c93b4ea2 /spec.txt
parent5ca9ca1d5e70cbfe8eeae12f96e761c405ad8f86 (diff)
ATX headers: clarify where tabs can go.
See #410.
Diffstat (limited to 'spec.txt')
-rw-r--r--spec.txt64
1 files changed, 41 insertions, 23 deletions
diff --git a/spec.txt b/spec.txt
index 32c99c2..738ee96 100644
--- a/spec.txt
+++ b/spec.txt
@@ -730,17 +730,18 @@ If you want a thematic break in a list item, use a different bullet:
## ATX headings
-An [ATX heading](@)
-consists of a string of characters, parsed as inline content, between an
-opening sequence of 1--6 unescaped `#` characters and an optional
-closing sequence of any number of unescaped `#` characters.
-The opening sequence of `#` characters must be followed by a
-[space] or by the end of line. The optional closing sequence of `#`s must be
-preceded by a [space] and may be followed by spaces only. The opening
-`#` 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 `#`
-characters in the opening sequence.
+An [ATX heading](@) consists of a string of characters, parsed
+as inline content, between an opening sequence of 1--6 unescaped
+`#` characters and an optional closing sequence of any number of
+unescaped `#` characters. The opening sequence of `#`
+characters must be followed by a [space], a tab, or by the end of
+the line. The optional closing sequence of `#`s must be preceded
+by a [space] or tab and may be followed by spaces or tabs only.
+The opening `#` character may be indented 0-3 spaces. The raw
+contents of the heading are stripped of leading and trailing
+spaces and tabs before being parsed as inline content. The
+heading level is equal to the number of `#` characters in the
+opening sequence.
Simple headings:
@@ -770,7 +771,7 @@ More than six `#` characters is not a heading:
````````````````````````````````
-At least one space is required between the `#` characters and the
+At least one space or tab is required between the `#` characters and the
heading's contents, unless the heading is empty. Note that many
implementations currently do not require the space. However, the
space was required by the
@@ -788,12 +789,21 @@ headings:
````````````````````````````````
-A tab will not work:
+A tab can be used instead of a space:
```````````````````````````````` example
#→foo
.
-<p>#→foo</p>
+<h1>foo</h1>
+````````````````````````````````
+
+
+Any number of spaces and tabs can be used after the `#`s:
+
+```````````````````````````````` example
+# →→ foo
+.
+<h1>foo</h1>
````````````````````````````````
@@ -815,16 +825,16 @@ Contents are parsed as inlines:
````````````````````````````````
-Leading and trailing blanks are ignored in parsing inline content:
+Leading and trailing spaces and tabs are ignored in parsing inline content:
```````````````````````````````` example
-# foo
+# →→ foo →→
.
<h1>foo</h1>
````````````````````````````````
-One to three spaces indentation are allowed:
+One to three spaces indentation are allowed before the first `#`:
```````````````````````````````` example
### foo
@@ -878,18 +888,18 @@ It need not be the same length as the opening sequence:
````````````````````````````````
-Spaces are allowed after the closing sequence:
+Spaces and tabs are allowed after the closing sequence:
```````````````````````````````` example
-### foo ###
+### foo ###→
.
<h3>foo</h3>
````````````````````````````````
-A sequence of `#` characters with anything but [spaces] following it
-is not a closing sequence, but counts as part of the contents of the
-heading:
+A sequence of `#` characters with anything but spaces or tabs
+following it is not a closing sequence, but counts as part of
+the contents of the heading:
```````````````````````````````` example
### foo ### b
@@ -898,7 +908,7 @@ heading:
````````````````````````````````
-The closing sequence must be preceded by a space:
+The closing sequence must be preceded by at least one space or tab:
```````````````````````````````` example
# foo#
@@ -906,6 +916,12 @@ The closing sequence must be preceded by a space:
<h1>foo#</h1>
````````````````````````````````
+```````````````````````````````` example
+# foo→#
+.
+<h1>foo</h1>
+````````````````````````````````
+
Backslash-escaped `#` characters do not count as part
of the closing sequence:
@@ -952,10 +968,12 @@ ATX headings can be empty:
##
#
### ###
+####→####
.
<h2></h2>
<h1></h1>
<h3></h3>
+<h4></h4>
````````````````````````````````