aboutsummaryrefslogtreecommitdiff
path: root/spec.txt
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-23 09:18:38 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-23 09:18:38 -0700
commit83ed53e12aa2e011b04474825bfb22a40682e4a0 (patch)
tree4d6ea50e767f2fd9e4cedb676785d30cc4d726df /spec.txt
parent9c6c62fcd36210c1233187c8ff9a5fa15f7f146d (diff)
Match interior delimiter runs if lengths of both are multiples of 3.
This gives better results on `a***b***c` without giving bad results on the cases that motivated the original multiple of 3 rule. Closes #528.
Diffstat (limited to 'spec.txt')
-rw-r--r--spec.txt26
1 files changed, 23 insertions, 3 deletions
diff --git a/spec.txt b/spec.txt
index 0760a6e..ffa0f9c 100644
--- a/spec.txt
+++ b/spec.txt
@@ -6109,7 +6109,8 @@ The following rules define emphasis and strong emphasis:
[delimiter runs]. If one of the delimiters can both
open and close emphasis, then the sum of the lengths of the
delimiter runs containing the opening and closing delimiters
- must not be a multiple of 3.
+ must not be a multiple of 3 unless both lengths are
+ multiples of 3.
10. Strong emphasis begins with a delimiter that
[can open strong emphasis] and ends with a delimiter that
@@ -6119,7 +6120,8 @@ The following rules define emphasis and strong emphasis:
[delimiter runs]. If one of the delimiters can both open
and close strong emphasis, then the sum of the lengths of
the delimiter runs containing the opening and closing
- delimiters must not be a multiple of 3.
+ delimiters must not be a multiple of 3 unless both lengths
+ are multiples of 3.
11. A literal `*` character cannot occur at the beginning or end of
`*`-delimited emphasis or `**`-delimited strong emphasis, unless it
@@ -6738,7 +6740,8 @@ is precluded by the condition that a delimiter that
can both open and close (like the `*` after `foo`)
cannot form emphasis if the sum of the lengths of
the delimiter runs containing the opening and
-closing delimiters is a multiple of 3.
+closing delimiters is a multiple of 3 unless
+both lengths are multiples of 3.
For the same reason, we don't get two consecutive
@@ -6778,6 +6781,23 @@ omitted:
````````````````````````````````
+When the lengths of the interior closing and opening
+delimiter runs are *both* multiples of 3, though,
+they can match to create emphasis:
+
+```````````````````````````````` example
+foo***bar***baz
+.
+<p>foo<em><strong>bar</strong></em>baz</p>
+````````````````````````````````
+
+```````````````````````````````` example
+foo******bar*********baz
+.
+<p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p>
+````````````````````````````````
+
+
Indefinite levels of nesting are possible:
```````````````````````````````` example