summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-09-10 08:56:20 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-09-11 11:17:41 -0700
commite245f1a2d5ec76807633806a5af1ebe52fe5bd6d (patch)
tree8670c1a47532f5e6d3c67776b729e76c393fdf88
parent6df247e24f2b12d6d1440001877967e2f7c90093 (diff)
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.
-rw-r--r--spec.txt9
1 files changed, 7 insertions, 2 deletions
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)
<a id="can-close-emphasis"></a> 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 `<strong>foo</strong>`, not `<em><em>foo</em></em>`,
+ and `***foo***` is `<strong><em>foo</em></strong>`, not
+ `<em><strong>foo</strong></em>` or `<em><em><em>foo</em></em></em>`.
+
These rules can be illustrated through a series of examples.
Simple emphasis: