From 7e255b7248fd98818dd0a9c550897e4bf916e1af Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 2 Jul 2016 22:19:48 -0700 Subject: Revert "Revert "Revert "ATX headers: clarify where tabs can go.""" This reverts commit ee779cb7f8ea3c6274aef89f9916931b907e211e. --- spec.txt | 64 +++++++++++++++++++++++----------------------------------------- 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/spec.txt b/spec.txt index 28401fb..eb81475 100644 --- a/spec.txt +++ b/spec.txt @@ -721,18 +721,17 @@ 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], 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. +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. Simple headings: @@ -762,7 +761,7 @@ More than six `#` characters is not a heading: ```````````````````````````````` -At least one space or tab is required between the `#` characters and the +At least one space 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 @@ -780,21 +779,12 @@ headings: ```````````````````````````````` -A tab can be used instead of a space: +A tab will not work: ```````````````````````````````` example #→foo . -

foo

-```````````````````````````````` - - -Any number of spaces and tabs can be used after the `#`s: - -```````````````````````````````` example -# →→ foo -. -

foo

+

#→foo

```````````````````````````````` @@ -816,16 +806,16 @@ Contents are parsed as inlines: ```````````````````````````````` -Leading and trailing spaces and tabs are ignored in parsing inline content: +Leading and trailing blanks are ignored in parsing inline content: ```````````````````````````````` example -# →→ foo →→ +# foo .

foo

```````````````````````````````` -One to three spaces indentation are allowed before the first `#`: +One to three spaces indentation are allowed: ```````````````````````````````` example ### foo @@ -879,18 +869,18 @@ It need not be the same length as the opening sequence: ```````````````````````````````` -Spaces and tabs are allowed after the closing sequence: +Spaces are allowed after the closing sequence: ```````````````````````````````` example -### foo ###→ +### foo ### .

foo

```````````````````````````````` -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: +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: ```````````````````````````````` example ### foo ### b @@ -899,7 +889,7 @@ the contents of the heading: ```````````````````````````````` -The closing sequence must be preceded by at least one space or tab: +The closing sequence must be preceded by a space: ```````````````````````````````` example # foo# @@ -907,12 +897,6 @@ The closing sequence must be preceded by at least one space or tab:

foo#

```````````````````````````````` -```````````````````````````````` example -# foo→# -. -

foo

-```````````````````````````````` - Backslash-escaped `#` characters do not count as part of the closing sequence: @@ -959,12 +943,10 @@ ATX headings can be empty: ## # ### ### -####→#### .

-

```````````````````````````````` -- cgit v1.2.3