From b0c091460eff3dab41deca3199d942b6fe4d846e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Fri, 17 Apr 2020 12:25:27 +0600 Subject: [PATCH 01/10] Add a sub-section for Zero-width space escapes Includes a couple of basic use-cases Fixes: commonmark-spec#643 --- spec.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec.txt b/spec.txt index c62df5bb..23614233 100644 --- a/spec.txt +++ b/spec.txt @@ -620,6 +620,28 @@ foo ```````````````````````````````` +## Zero-width space escapes + +Zero width space can be used to ensure emphasis in East Asian text: + +```````````````````````````````` example +棕色*狐狸。*​跳过 +. +

棕色狐狸。​跳过

+```````````````````````````````` + + +Zero width space escapes can also be used in to achieve some combined effects +such as mixed bold/italic mark-up: + +```````````````````````````````` example +**bold*bold-italic***​*italic*​***bold-italic*bold** +. +

boldbold-italicitalicbold-italicbold

+ +```````````````````````````````` + + ## Entity and numeric character references Valid HTML entity references and numeric character references From 0ce587d3487d11788c9f7593f71e794aa06fc70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Fri, 17 Apr 2020 12:33:18 +0600 Subject: [PATCH 02/10] Additional sentence for Zero-width space escapes Fixes: commonmark-spec#643 --- spec.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec.txt b/spec.txt index 23614233..9c5e8d64 100644 --- a/spec.txt +++ b/spec.txt @@ -622,6 +622,8 @@ foo ## Zero-width space escapes +For most use-cases requiring an escape it's worth considering using backslash escapes first, but zero-width space escapes can useful sometimes as well. + Zero width space can be used to ensure emphasis in East Asian text: ```````````````````````````````` example From b696bfd6a42357383d9cb7716f85f1a2e4344db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Fri, 17 Apr 2020 14:01:27 +0600 Subject: [PATCH 03/10] Some wording tweaks for Zero-width space Fixes: commonmark-spec#643 --- spec.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec.txt b/spec.txt index 9c5e8d64..10871c13 100644 --- a/spec.txt +++ b/spec.txt @@ -620,11 +620,11 @@ foo ```````````````````````````````` -## Zero-width space escapes +## Zero-width space (escapes) -For most use-cases requiring an escape it's worth considering using backslash escapes first, but zero-width space escapes can useful sometimes as well. +For most use-cases requiring escapes it's worth considering using backslash escapes, but zero-width space can be useful sometimes as well (including as an escape character). -Zero width space can be used to ensure emphasis in East Asian text: +Zero-width space can be used to ensure emphasis in East Asian text: ```````````````````````````````` example 棕色*狐狸。*​跳过 @@ -633,7 +633,7 @@ Zero width space can be used to ensure emphasis in East Asian text: ```````````````````````````````` -Zero width space escapes can also be used in to achieve some combined effects +Zero-width space escapes can also be used to achieve some combined effects such as mixed bold/italic mark-up: ```````````````````````````````` example From 38875f3360d2ef37ad733ea0e730d716b7c87d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Fri, 17 Apr 2020 14:21:11 +0600 Subject: [PATCH 04/10] Some more wording tweaks for Zero-width space Fixes: commonmark-spec#643 --- spec.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec.txt b/spec.txt index 10871c13..6cc0a95b 100644 --- a/spec.txt +++ b/spec.txt @@ -620,9 +620,11 @@ foo ```````````````````````````````` -## Zero-width space (escapes) +## Zero-width space -For most use-cases requiring escapes it's worth considering using backslash escapes, but zero-width space can be useful sometimes as well (including as an escape character). +For most use-cases requiring escapes it's worth considering using backslash +escapes, but zero-width space can be useful sometimes as well (to change the +meaning of a neighboring character). Zero-width space can be used to ensure emphasis in East Asian text: @@ -633,8 +635,8 @@ Zero-width space can be used to ensure emphasis in East Asian text: ```````````````````````````````` -Zero-width space escapes can also be used to achieve some combined effects -such as mixed bold/italic mark-up: +Zero-width space can also be used to achieve some combined effects such as mixed +bold/italic mark-up: ```````````````````````````````` example **bold*bold-italic***​*italic*​***bold-italic*bold** From 241967845583f8562de2baad61d2fd3205c791dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Fri, 17 Apr 2020 16:26:54 +0600 Subject: [PATCH 05/10] Mention differences in utilization of whitespace in East Asian languages (in Zero-width space sub-section) Fixes: commonmark-spec#643 --- spec.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec.txt b/spec.txt index 6cc0a95b..e21decbe 100644 --- a/spec.txt +++ b/spec.txt @@ -626,7 +626,8 @@ For most use-cases requiring escapes it's worth considering using backslash escapes, but zero-width space can be useful sometimes as well (to change the meaning of a neighboring character). -Zero-width space can be used to ensure emphasis in East Asian text: +Given differences in utilization of whitespace, zero-width space can be used to +ensure emphasis, etc. in East Asian text: ```````````````````````````````` example 棕色*狐狸。*​跳过 From 6144fbc5f60d56aa5922bfcc1bf6e9e20da8fc18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Mon, 20 Apr 2020 12:31:28 +0600 Subject: [PATCH 06/10] Minor wording tweak in zero-width space sub-section Fixes: commonmark-spec#643 --- spec.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.txt b/spec.txt index e21decbe..e908f3ba 100644 --- a/spec.txt +++ b/spec.txt @@ -624,7 +624,7 @@ foo For most use-cases requiring escapes it's worth considering using backslash escapes, but zero-width space can be useful sometimes as well (to change the -meaning of a neighboring character). +meaning of an adjacent character). Given differences in utilization of whitespace, zero-width space can be used to ensure emphasis, etc. in East Asian text: From 5bcc21880e3e27cf0bc19a1bb6a5ef3a79ff3801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Fri, 24 Apr 2020 12:10:25 +0600 Subject: [PATCH 07/10] Add a link to Backslash escapes sub-section around reference to "backslash escapes" in zero-width space sub-section Fixes: commonmark-spec#643 --- spec.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.txt b/spec.txt index e908f3ba..d1950132 100644 --- a/spec.txt +++ b/spec.txt @@ -622,8 +622,8 @@ foo ## Zero-width space -For most use-cases requiring escapes it's worth considering using backslash -escapes, but zero-width space can be useful sometimes as well (to change the +For most use-cases requiring escapes it's worth considering using [backslash +escapes], but zero-width space can be useful sometimes as well (to change the meaning of an adjacent character). Given differences in utilization of whitespace, zero-width space can be used to From 3ed1b9167adcd33c22f6dd17bc3818a35b651217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Fri, 24 Apr 2020 12:42:26 +0600 Subject: [PATCH 08/10] Add a definition of Zero-width space, & link to it from definition of Unicode whitespace character and from Zero-width space sub-section Fixes: commonmark-spec#643 --- spec.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spec.txt b/spec.txt index d1950132..9409fda2 100644 --- a/spec.txt +++ b/spec.txt @@ -313,10 +313,15 @@ form feed (`U+000C`), or carriage return (`U+000D`). [Whitespace](@) is a sequence of one or more [whitespace characters]. +A [zero-width space](@) character is a non-printing and usually invisible +character (`U+000D`) (encodable in HTML as \​ or \​), which can be +used, for instance, for special spacing effects in text (and which in Markdown +can also be used to change the meaning of an adjacent character). + A [Unicode whitespace character](@) is any code point in the Unicode `Zs` general category, or a tab (`U+0009`), -carriage return (`U+000D`), newline (`U+000A`), or form feed -(`U+000C`). +carriage return (`U+000D`), newline (`U+000A`), form feed +(`U+000C`), or [zero-width space]. [Unicode whitespace](@) is a sequence of one or more [Unicode whitespace characters]. @@ -623,8 +628,8 @@ foo ## Zero-width space For most use-cases requiring escapes it's worth considering using [backslash -escapes], but zero-width space can be useful sometimes as well (to change the -meaning of an adjacent character). +escapes], but [zero-width space] can be useful sometimes as well (to change the +meaning of an adjacent character, etc.). Given differences in utilization of whitespace, zero-width space can be used to ensure emphasis, etc. in East Asian text: From fabc5040a2c6ae85d4081de235fdc20218631607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Fri, 24 Apr 2020 13:14:15 +0600 Subject: [PATCH 09/10] In Zero-width space sub-section, add 2 examples for cases in which zero-width space may be required to satisfy left/right-flanking delimiter run rules (with reference to Emphasis and strong emphasis sub-section) Fixes: #643 --- spec.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec.txt b/spec.txt index 9409fda2..22db463c 100644 --- a/spec.txt +++ b/spec.txt @@ -641,6 +641,24 @@ ensure emphasis, etc. in East Asian text: ```````````````````````````````` +Zero-width space may also need to be used to achieve some emphasis effects +while satisfying Markdown's [emphasis and strong emphasis] rules: + +```````````````````````````````` example +Hello *Super-*​**man** +. +

Hello Super-man

+ +```````````````````````````````` + +```````````````````````````````` example +Hello ***Super***​**-man** +. +

Hello Super-man

+ +```````````````````````````````` + + Zero-width space can also be used to achieve some combined effects such as mixed bold/italic mark-up: From e9362c8b78ad761e9c42d5ec09ac2a41e4414e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C5=9Fat=20SABIQ?= Date: Mon, 3 Aug 2020 21:10:23 +0600 Subject: [PATCH 10/10] In additional paragraph in Characters and lines sub-section (proposed in relation to Zero-width space sub-section), fix up the U+ notation of the ZWS character (to match the hexadecimal HTML entity 5 words later) Fixes: #643 --- spec.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.txt b/spec.txt index 214d9f87..fe119e5f 100644 --- a/spec.txt +++ b/spec.txt @@ -307,7 +307,7 @@ A line containing no characters, or a line containing only spaces The following definitions of character classes will be used in this spec: A [zero-width space](@) character is a non-printing and usually invisible -character (`U+000D`) (encodable in HTML as \​ or \​), which can be +character (`U+200B`) (encodable in HTML as \​ or \​), which can be used, for instance, for special spacing effects in text (and which in Markdown can also be used to change the meaning of an adjacent character).