Skip to content

Commit

Permalink
ATX headers: clarify that a space (or EOL) is needed.
Browse files Browse the repository at this point in the history
Other whitespace won't do.

Added a test case and modified an existing one to
make this clearer.

Closes #373.
  • Loading branch information
jgm committed Dec 29, 2015
1 parent bac75b8 commit 3469e39
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,8 @@ An [ATX heading](@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 cannot be followed directly by a
[non-whitespace character]. The optional closing sequence of `#`s must be
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
Expand Down Expand Up @@ -623,10 +623,18 @@ headings:
.
#5 bolt

#foobar
#hashtag
.
<p>#5 bolt</p>
<p>#foobar</p>
<p>#hashtag</p>
.

A tab will not work:

.
#→foo
.
<p># foo</p>
.

This is not a heading, because the first `#` is escaped:
Expand Down

0 comments on commit 3469e39

Please sign in to comment.