Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify wording in spec for character groups #618

Merged
merged 21 commits into from
May 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Do away with ranges and use words instead
  • Loading branch information
wooorm committed May 23, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 69abb8164061d12ea3f22f094b1ed8ee4f882c3d
58 changes: 30 additions & 28 deletions spec.txt
Original file line number Diff line number Diff line change
@@ -862,8 +862,8 @@ Markdown document.

## Thematic breaks

A line consisting of 0-3 spaces of indentation, followed by a sequence
of three or more matching `-`, `_`, or `*` characters, each followed
A line consisting of optionally up to three spaces of indentation, followed by a
sequence of three or more matching `-`, `_`, or `*` characters, each followed
optionally by any number of spaces or tabs, forms a
[thematic break](@).

@@ -907,7 +907,7 @@ __</p>
````````````````````````````````


One to three spaces of indentation are allowed:
Up to three spaces of indentation are allowed:

```````````````````````````````` example
***
@@ -1093,10 +1093,10 @@ closing sequence of any number of unescaped `#` characters.
The opening sequence of `#` characters must be followed by spaces or tabs, or
by the end of line. The optional closing sequence of `#`s must be preceded by
spaces or tabs and may be followed by spaces or tabs only. The opening
`#` character may be preceded by 1-3 spaces of indentation. The raw contents of
the heading are stripped of leading and trailing space or tabs before being
parsed as inline content. The heading level is equal to the number of `#`
characters in the opening sequence.
`#` character may be preceded by up to three spaces of indentation. The raw
contents of the heading are stripped of leading and trailing space or tabs
before being parsed as inline content. The heading level is equal to the number
of `#` characters in the opening sequence.

Simple headings:

@@ -1171,7 +1171,7 @@ Leading and trailing spaces or tabs are ignored in parsing inline content:
````````````````````````````````


One to three spaces of indentation are allowed:
Up to three spaces of indentation are allowed:

```````````````````````````````` example
### foo
@@ -1184,7 +1184,7 @@ One to three spaces of indentation are allowed:
````````````````````````````````


Four spaces of indentation are too much:
Four spaces of indentation is too many:

```````````````````````````````` example
# foo
@@ -1409,7 +1409,7 @@ need not line up with the underlining:
````````````````````````````````


Four spaces of indentation is too much:
Four spaces of indentation is too many:

```````````````````````````````` example
Foo
@@ -1438,7 +1438,7 @@ Foo
````````````````````````````````


Four spaces of indentation is too much:
Four spaces of indentation is too many:

```````````````````````````````` example
Foo
@@ -1931,7 +1931,7 @@ A [code fence](@) is a sequence
of at least three consecutive backtick characters (`` ` ``) or
tildes (`~`). (Tildes and backticks cannot be mixed.)
A [fenced code block](@)
begins with a code fence, preceded by no more than three spaces of indentation.
begins with a code fence, preceded by up to three spaces of indentation.

The line with the opening code fence may optionally contain some text
following the code fence; this is trimmed of leading and trailing
@@ -2164,7 +2164,7 @@ aaa
````````````````````````````````


Four spaces of indentation produces an indented code block:
Four spaces of indentation is too many:

```````````````````````````````` example
```
@@ -2178,7 +2178,7 @@ aaa
````````````````````````````````


Closing fences may be preceded by 1-3 spaces of indentation, and their
Closing fences may be preceded by up to three spaces of indentation, and their
indentation need not match that of the opening fence:

```````````````````````````````` example
@@ -2938,7 +2938,8 @@ function matchwo(a,b)
````````````````````````````````


The opening tag can be preceded by 1-3 spaces of indentation, but not 4:
The opening tag can be preceded by up to three spaces of indentation, but not
four:

```````````````````````````````` example
<!-- foo -->
@@ -3568,8 +3569,8 @@ ccc</p>
````````````````````````````````


However, the first line may be preceded by at most three spaces of indentation,
or an indented code block will be triggered:
However, the first line may be preceded by up to three spaces of indentation.
Four spaces of indentation is too many:

```````````````````````````````` example
aaa
@@ -3649,10 +3650,11 @@ these constructions. (A recipe is provided below in the section entitled

## Block quotes

A [block quote marker](@)
consists of 0-3 spaces of indentation, plus (a) the character `>` together
with a following space of indentation, or (b) a single character `>` not
followed by a space of indentation.
A [block quote marker](@),
optionally preceded by up to three spaces of indentation,
consists of (a) the character `>` together with a following space of
indentation, or (b) a single character `>` not followed by a space of
indentation.

The following rules define [block quotes]:

@@ -3706,7 +3708,7 @@ baz</p>
````````````````````````````````


The `>` characters can be preceded by 1-3 spaces of indentation:
The `>` characters can be preceded by up to three spaces of indentation:

```````````````````````````````` example
> # Foo
@@ -3721,7 +3723,7 @@ baz</p>
````````````````````````````````


Four spaces of indentation gives us a code block:
Four spaces of indentation is too many:

```````````````````````````````` example
> # Foo
@@ -4538,8 +4540,8 @@ bar
````````````````````````````````


This is not a significant restriction, because when a block begins
with 1-3 spaces of indentation, the indentation can always be removed without
This is not a significant restriction, because when a block is preceded by up to
three spaces of indentation, the indentation can always be removed without
a change in interpretation, allowing rule #1 to be applied. So, in
the above case:

@@ -4695,7 +4697,7 @@ foo

4. **Indentation.** If a sequence of lines *Ls* constitutes a list item
according to rule #1, #2, or #3, then the result of preceding each line
of *Ls* by 1-3 spaces of indentation (the same for each line) also
of *Ls* by up to three spaces of indentation (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.

@@ -5113,8 +5115,8 @@ The choice of four spaces is arbitrary. It can be learned, but it is
not likely to be guessed, and it trips up beginners regularly.

Would it help to adopt a two-space rule? The problem is that such
a rule, together with the rule allowing 1--3 spaces indentation of the
initial list marker, allows text that is indented *less than* the
a rule, together with the rule allowing up to three spaces of indentation for
the initial list marker, allows text that is indented *less than* the
original list marker to be included in the list item. For example,
`Markdown.pl` parses