From 83ed53e12aa2e011b04474825bfb22a40682e4a0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 23 Mar 2019 09:18:38 -0700 Subject: 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. --- spec.txt | 26 +++++++++++++++++++++++--- 1 file 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 +. +

foobarbaz

+```````````````````````````````` + +```````````````````````````````` example +foo******bar*********baz +. +

foobar***baz

+```````````````````````````````` + + Indefinite levels of nesting are possible: ```````````````````````````````` example -- cgit v1.2.3