From 6a254f5d3c0e1f0d333c75d2bd7a95841b96d8aa Mon Sep 17 00:00:00 2001 From: Sandra Snan Date: Mon, 27 Mar 2023 09:09:30 +0200 Subject: [PATCH] Allow implementers to emit i and b Issue #652. --- spec.txt | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/spec.txt b/spec.txt index ce0cd10a..ad9e1ba8 100644 --- a/spec.txt +++ b/spec.txt @@ -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 `` and `` instead of `` and ``. + +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 `...` is always preferred to `...`. -14. An interpretation `...` is always +15. An interpretation `...` is always preferred to `...`. -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 `foo _bar baz_` rather than `*foo bar* baz`. -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 bar baz` rather than `foo **bar baz`. -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 @@ -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 @@ -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 @@ -7328,7 +7330,7 @@ delimiters: ```````````````````````````````` -Rule 14: +Rule 15: ```````````````````````````````` example ***foo*** @@ -7344,7 +7346,7 @@ _____foo_____ ```````````````````````````````` -Rule 15: +Rule 16: ```````````````````````````````` example *foo _bar* baz_ @@ -7360,7 +7362,7 @@ Rule 15: ```````````````````````````````` -Rule 16: +Rule 17: ```````````````````````````````` example **foo **bar baz** @@ -7376,7 +7378,7 @@ Rule 16: ```````````````````````````````` -Rule 17: +Rule 18: ```````````````````````````````` example *[bar*](/url)