From adfa8750cd771688156e0f386b980f9214c4063b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bengt=20L=C3=BCers?= Date: Fri, 12 Sep 2014 20:22:58 +0200 Subject: Add example from issue #94 about indented code block closing fences --- spec.txt | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'spec.txt') diff --git a/spec.txt b/spec.txt index 82ae0b6..dbe779b 100644 --- a/spec.txt +++ b/spec.txt @@ -1219,6 +1219,56 @@ aaa . +Closing fences may be indented by 0-3 spaces: + +. +``` +code +``` +. +
code
+
+. + +. +``` +code + ``` +. +
code
+
+. + +. +``` +code + ``` +. +
code
+
+. + +. +``` +code + ``` +. +
code
+
+. + +But not by 4: + +. +``` +aaa + ``` +. +
aaa
+    ```
+
+. + Four spaces indentation produces an indented code block: . @@ -6133,5 +6183,3 @@ an `emph`. The document can be rendered as HTML, or in any other format, given an appropriate renderer. - - -- cgit v1.2.3 From 15422f68253bd5d877f0b308b1bf6caec6e0eb79 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 26 Oct 2014 00:26:38 -0700 Subject: Tweaked the closing fence section added in last commit. --- spec.txt | 46 +++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) (limited to 'spec.txt') diff --git a/spec.txt b/spec.txt index c226866..e5953bd 100644 --- a/spec.txt +++ b/spec.txt @@ -1288,45 +1288,41 @@ aaa . -Closing fences may be indented by 0-3 spaces: +Four spaces indentation produces an indented code block: . -``` -code -``` -. -
code
-
-. - + ``` + aaa + ``` . +
```
+aaa
 ```
-code
- ```
-.
-
code
 
. +Closing fences may be indented by 0-3 spaces, and their indentation +need not match that of the opening fence: + . ``` -code +aaa ``` . -
code
+
aaa
 
. . -``` -code ``` +aaa + ``` . -
code
+
aaa
 
. -But not by 4: +This is not a closing fence, because it is indented 4 spaces: . ``` @@ -1338,18 +1334,6 @@ aaa
. -Four spaces indentation produces an indented code block: - -. - ``` - aaa - ``` -. -
```
-aaa
-```
-
-. Code fences (opening and closing) cannot contain internal spaces: -- cgit v1.2.3 From e618715636a3bd60930bea34d214b3aaf8e9e766 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 26 Oct 2014 12:37:59 -0700 Subject: Require space before closing # sequence in ATX header. Closes #169. --- spec.txt | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'spec.txt') diff --git a/spec.txt b/spec.txt index e5953bd..5070b3b 100644 --- a/spec.txt +++ b/spec.txt @@ -479,11 +479,11 @@ 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 `#` characters. The opening sequence of `#` characters cannot be followed directly by a nonspace character. -The closing `#` characters may be followed by spaces only. The opening -`#` character may be indented 0-3 spaces. The raw contents of the -header are stripped of leading and trailing spaces before being parsed -as inline content. The header level is equal to the number of `#` -characters in the opening sequence. +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 header are stripped of leading and +trailing spaces before being parsed as inline content. The header level +is equal to the number of `#` characters in the opening sequence. Simple headers: @@ -614,16 +614,24 @@ header:

foo ### b

. +The closing sequence must be preceded by a space: + +. +# foo# +. +

foo#

+. + Backslash-escaped `#` characters do not count as part of the closing sequence: . ### foo \### -## foo \#\## +## foo #\## # foo \# . -

foo #

-

foo ##

+

foo ###

+

foo ###

foo #

. -- cgit v1.2.3 From 1195f302fe483577e007b127f2c3175fde88d631 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 27 Oct 2014 08:49:58 -0700 Subject: Updated spec date/version. --- spec.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec.txt') diff --git a/spec.txt b/spec.txt index 5070b3b..2459321 100644 --- a/spec.txt +++ b/spec.txt @@ -2,8 +2,8 @@ title: CommonMark Spec author: - John MacFarlane -version: 0.5 -date: 2014-10-25 +version: 0.6 +date: 2014-10-26 ... # Introduction -- cgit v1.2.3 From 6459d419cdd09b6006258762e26a72aa17e6d48a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 28 Oct 2014 21:52:31 -0700 Subject: Clarified emph/strong rules. Make it clear that in `**foo **bar baz**` the shorter of the two potential strong emphasis spans (`bar baz`) is preferred. --- spec.txt | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'spec.txt') diff --git a/spec.txt b/spec.txt index 2459321..a3ac6c0 100644 --- a/spec.txt +++ b/spec.txt @@ -4328,15 +4328,21 @@ the following principles resolve ambiguity: 12. An interpretation `...` is always preferred to `..`. -13. Earlier closings are preferred to later closings. Thus, - when two potential emphasis or strong emphasis spans overlap, - the first takes precedence: for example, `*foo _bar* baz_` - is parsed as `foo _bar baz_` rather than - `*foo bar* baz`. For the same reason, +13. When two potential emphasis or strong emphasis spans overlap, + so that the second begins before the first ends and ends after + the first ends, the first is preferred. Thus, for example, + `*foo _bar* baz_` is parsed as `foo _bar baz_` rather + than `*foo bar* baz`. For the same reason, `**foo*bar**` is parsed as `foobar*` rather than `foo*bar`. -14. Inline code spans, links, images, and HTML tags group more tightly +14. When there are two potential emphasis or strong emphasis spans + with the same closing delimiter, the shorter one (the one that + opens later) is preferred. Thus, for example, + `**foo **bar baz**` is parsed as `**foo bar baz` + rather than `foo **bar baz`. + +15. Inline code spans, links, images, and HTML tags group more tightly than emphasis. So, when there is a choice between an interpretation that contains one of these elements and one that does not, the former always wins. Thus, for example, `*[foo*](bar)` is @@ -4969,6 +4975,20 @@ The following cases illustrate rule 13: The following cases illustrate rule 14: +. +**foo **bar baz** +. +

**foo bar baz

+. + +. +*foo *bar baz* +. +

*foo bar baz

+. + +The following cases illustrate rule 15: + . *[foo*](bar) . -- cgit v1.2.3 From eb8087e9714eaeb8b1427e7fd9cd2a703487b383 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 28 Oct 2014 21:58:25 -0700 Subject: Update spec version. --- spec.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec.txt') diff --git a/spec.txt b/spec.txt index a3ac6c0..1bbd287 100644 --- a/spec.txt +++ b/spec.txt @@ -2,8 +2,8 @@ title: CommonMark Spec author: - John MacFarlane -version: 0.6 -date: 2014-10-26 +version: 0.7 +date: 2014-10-28 ... # Introduction -- cgit v1.2.3