From e245f1a2d5ec76807633806a5af1ebe52fe5bd6d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 10 Sep 2014 08:56:20 -0700 Subject: Updated spec (but not yet examples) with new rules. These reflect the current parsing algorithm. We now get a symmetry that we lacked before: **a* b* *a *b** are both emphasis within emphasis. One asymmetry remains: **a* has no emphasis, while *a** has emphasis. Further tweaking of the algorithm could regularize this. --- spec.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'spec.txt') diff --git a/spec.txt b/spec.txt index 4a9e9fd..37f92c5 100644 --- a/spec.txt +++ b/spec.txt @@ -4024,7 +4024,7 @@ for efficient parsing strategies that do not backtrack: (a) it is not part of a sequence of four or more unescaped `*`s, (b) it is not followed by whitespace, and (c) either it is not followed by a `*` character or it is - followed immediately by strong emphasis. + followed immediately by emphasis or strong emphasis. 2. A single `_` character [can open emphasis](#can-open-emphasis) iff @@ -4032,7 +4032,7 @@ for efficient parsing strategies that do not backtrack: (b) it is not followed by whitespace, (c) is is not preceded by an ASCII alphanumeric character, and (d) either it is not followed by a `_` character or it is - followed immediately by strong emphasis. + followed immediately by emphasis or strong emphasis. 3. A single `*` character [can close emphasis](#can-close-emphasis) iff @@ -4088,6 +4088,11 @@ for efficient parsing strategies that do not backtrack: emphasis](#can-close-strong-emphasis), and that uses the same character (`_` or `*`) as the opening delimiter, is reached. +11. In case of ambiguity, strong emphasis takes precedence. Thus, + `**foo**` is `foo`, not `foo`, + and `***foo***` is `foo`, not + `foo` or `foo`. + These rules can be illustrated through a series of examples. Simple emphasis: -- cgit v1.2.3