aboutsummaryrefslogtreecommitdiff
path: root/spec.txt
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-04-27 22:46:02 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-04-27 22:46:02 -0700
commitf167c32721e78621bb86befe34a56a2f463e0e03 (patch)
tree8525884e7af6fb0080a6a1d493afe5aa18ac23c4 /spec.txt
parent44ecb92c16b5f88cf5d3c7d6648db5de33c27939 (diff)
Fixed rules for `_`-based emphasis and strong emphasis.
Previously this was not counted as emphasis _(bar)_. because the closing delimiter is both left- and right- flanking. This fix allows such delimiters, provided they're followed by punctuation (= they have punctuation on both sides). Similarly, mutatis mutandis, for opening delimiters and for `__`. Closes #317.
Diffstat (limited to 'spec.txt')
-rw-r--r--spec.txt67
1 files changed, 58 insertions, 9 deletions
diff --git a/spec.txt b/spec.txt
index c2a867d..f61f5d5 100644
--- a/spec.txt
+++ b/spec.txt
@@ -4643,28 +4643,36 @@ The following rules define emphasis and strong emphasis:
2. A single `_` character [can open emphasis] iff
it is part of a [left-flanking delimiter run]
- and not part of a [right-flanking delimiter run].
+ and either (a) not part of a [right-flanking delimiter run]
+ or (b) part of a [right-flanking delimeter run]
+ preceded by punctuation.
3. A single `*` character [can close emphasis](@can-close-emphasis)
iff it is part of a [right-flanking delimiter run].
-4. A single `_` character [can close emphasis]
- iff it is part of a [right-flanking delimiter run]
- and not part of a [left-flanking delimiter run].
+4. A single `_` character [can close emphasis] iff
+ it is part of a [right-flanking delimiter run]
+ and either (a) not part of a [left-flanking delimiter run]
+ or (b) part of a [left-flanking delimeter run]
+ followed by punctuation.
5. A double `**` [can open strong emphasis](@can-open-strong-emphasis)
iff it is part of a [left-flanking delimiter run].
-6. A double `__` [can open strong emphasis]
- iff it is part of a [left-flanking delimiter run]
- and not part of a [right-flanking delimiter run].
+6. A double `__` [can open strong emphasis] iff
+ it is part of a [left-flanking delimiter run]
+ and either (a) not part of a [right-flanking delimiter run]
+ or (b) part of a [right-flanking delimeter run]
+ preceded by punctuation.
7. A double `**` [can close strong emphasis](@can-close-strong-emphasis)
iff it is part of a [right-flanking delimiter run].
8. A double `__` [can close strong emphasis]
- iff it is part of a [right-flanking delimiter run]
- and not part of a [left-flanking delimiter run].
+ it is part of a [right-flanking delimiter run]
+ and either (a) not part of a [left-flanking delimiter run]
+ or (b) part of a [left-flanking delimeter run]
+ followed by punctuation.
9. Emphasis begins with a delimiter that [can open emphasis] and ends
with a delimiter that [can close emphasis], and that uses the same
@@ -4835,6 +4843,16 @@ both left- and right-flanking:
<p>&quot;aa&quot;_&quot;bb&quot;_&quot;cc&quot;</p>
.
+This is emphasis, even though the opening delimiter is
+both left- and right-flanking, because it is preceded by
+punctuation:
+
+.
+foo-_(bar)
+.
+<p>foo-<em>(bar)</em></p>
+.
+
Rule 3:
This is not emphasis, because the closing delimiter does
@@ -4943,6 +4961,16 @@ _foo_bar_baz_
<p><em>foo_bar_baz</em></p>
.
+This is emphasis, even though the closing delimiter is
+both left- and right-flanking, because it is followed by
+punctuation:
+
+.
+_(bar)_.
+.
+<p><em>(bar)</em>.</p>
+.
+
Rule 5:
.
@@ -5039,6 +5067,17 @@ __foo, __bar__, baz__
<p><strong>foo, <strong>bar</strong>, baz</strong></p>
.
+This is strong emphasis, even though the opening delimiter is
+both left- and right-flanking, because it is preceded by
+punctuation:
+
+.
+foo-_(bar)_
+.
+<p>foo-<em>(bar)</em></p>
+.
+
+
Rule 7:
This is not strong emphasis, because the closing delimiter is preceded
@@ -5142,6 +5181,16 @@ __foo__bar__baz__
<p><strong>foo__bar__baz</strong></p>
.
+This is strong emphasis, even though the closing delimiter is
+both left- and right-flanking, because it is followed by
+punctuation:
+
+.
+_(bar)_.
+.
+<p><em>(bar)</em>.</p>
+.
+
Rule 9:
Any nonempty sequence of inline elements can be the contents of an