Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master #734

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6273,29 +6273,31 @@ The following rules define emphasis and strong emphasis:
`_`-delimited emphasis or `__`-delimited strong emphasis, unless it
is backslash-escaped.

Where rules 1--12 above are compatible with multiple parsings,
13. Implementers can emit `<i>` and `<b>` instead of `<em>` and `<strong>`.

Where rules 1--13 above are compatible with multiple parsings,
the following principles resolve ambiguity:

13. The number of nestings should be minimized. Thus, for example,
14. The number of nestings should be minimized. Thus, for example,
an interpretation `<strong>...</strong>` is always preferred to
`<em><em>...</em></em>`.

14. An interpretation `<em><strong>...</strong></em>` is always
15. An interpretation `<em><strong>...</strong></em>` is always
preferred to `<strong><em>...</em></strong>`.

15. When two potential emphasis or strong emphasis spans overlap,
16. When two potential emphasis or strong emphasis spans overlap,
so that the second begins before the first ends and ends after
the first ends, the first takes precedence. Thus, for example,
`*foo _bar* baz_` is parsed as `<em>foo _bar</em> baz_` rather
than `*foo <em>bar* baz</em>`.

16. When there are two potential emphasis or strong emphasis spans
17. When there are two potential emphasis or strong emphasis spans
with the same closing delimiter, the shorter one (the one that
opens later) takes precedence. Thus, for example,
`**foo **bar baz**` is parsed as `**foo <strong>bar baz</strong>`
rather than `<strong>foo **bar baz</strong>`.

17. Inline code spans, links, images, and HTML tags group more tightly
18. Inline code spans, links, images, and HTML tags group more tightly
than emphasis. So, when there is a choice between an interpretation
that contains one of these elements and one that does not, the
former always wins. Thus, for example, `*[foo*](bar)` is
Expand Down Expand Up @@ -6720,8 +6722,8 @@ with these examples:
**Gomphocarpus (*Gomphocarpus physocarpus*, syn.
*Asclepias physocarpa*)**
.
<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn.
<em>Asclepias physocarpa</em>)</strong></p>
<p><b>Gomphocarpus (<i>Gomphocarpus physocarpus</i>, syn.
<i>Asclepias physocarpa</i>)</b></p>
````````````````````````````````


Expand Down Expand Up @@ -7269,7 +7271,7 @@ _foo____
````````````````````````````````


Rule 13 implies that if you want emphasis nested directly inside
Rule 14 implies that if you want emphasis nested directly inside
emphasis, you must use different delimiters:

```````````````````````````````` example
Expand Down Expand Up @@ -7318,7 +7320,7 @@ ____foo____



Rule 13 can be applied to arbitrarily long sequences of
Rule 14 can be applied to arbitrarily long sequences of
delimiters:

```````````````````````````````` example
Expand All @@ -7328,7 +7330,7 @@ delimiters:
````````````````````````````````


Rule 14:
Rule 15:

```````````````````````````````` example
***foo***
Expand All @@ -7344,7 +7346,7 @@ _____foo_____
````````````````````````````````


Rule 15:
Rule 16:

```````````````````````````````` example
*foo _bar* baz_
Expand All @@ -7360,7 +7362,7 @@ Rule 15:
````````````````````````````````


Rule 16:
Rule 17:

```````````````````````````````` example
**foo **bar baz**
Expand All @@ -7376,7 +7378,7 @@ Rule 16:
````````````````````````````````


Rule 17:
Rule 18:

```````````````````````````````` example
*[bar*](/url)
Expand Down