From 64966ba41af23b0c2fb9aa926fd4cc08dc84388f Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang <1696128+deniak@users.noreply.github.com> Date: Wed, 25 Mar 2026 15:04:30 +0400 Subject: [PATCH 1/4] Update em dash line-ending handling Change em dash representation to include a space. --- bikeshed/h/parser/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bikeshed/h/parser/parser.py b/bikeshed/h/parser/parser.py index c036bf45dd..48a4b4aa3d 100644 --- a/bikeshed/h/parser/parser.py +++ b/bikeshed/h/parser/parser.py @@ -474,7 +474,7 @@ def parseNode( match, i, _ = s.matchRe(start, emdashRe) if match is not None: # Fix line-ending em dashes, or --, by moving the previous line up, so no space. - node = RawText.fromStream(s, start, i, "—\u200b") + node = RawText.fromStream(s, start, i, "— ") return Ok(node, i) if first1 in ("<", "&"): From 48e7a9b2b2a9c91342b042a06d41256421ebc3f9 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang <1696128+deniak@users.noreply.github.com> Date: Wed, 25 Mar 2026 15:16:16 +0400 Subject: [PATCH 2/4] Update comment for line-ending em dashes handling --- bikeshed/h/parser/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bikeshed/h/parser/parser.py b/bikeshed/h/parser/parser.py index 48a4b4aa3d..12a3ed4be4 100644 --- a/bikeshed/h/parser/parser.py +++ b/bikeshed/h/parser/parser.py @@ -473,7 +473,7 @@ def parseNode( if first2 == "—\n" or first3 == "--\n": match, i, _ = s.matchRe(start, emdashRe) if match is not None: - # Fix line-ending em dashes, or --, by moving the previous line up, so no space. + # Fix line-ending em dashes, or --, by moving the previous line up with an extra space. node = RawText.fromStream(s, start, i, "— ") return Ok(node, i) From ea5d141da05bae7ee3a3ac33aad4eaa5f5c1113b Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang <1696128+deniak@users.noreply.github.com> Date: Wed, 25 Mar 2026 15:17:32 +0400 Subject: [PATCH 3/4] Fix em dash formatting description in index.bs Corrected the description of how em dashes are formatted. --- docs/index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.bs b/docs/index.bs index 8d09ce036e..1bdf636527 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -2047,7 +2047,7 @@ Typography Fixes {#typography} Bikeshed will automatically handle a few typographic niceties for you, ones that it can reliably detect: * Possessive apostrophes, and most contraction apostrophes, are automatically turned into curly right single quotes (`’`). -* Ending a line with `--` will turn it into an em dash (`—`) and pull the following line upwards so there's no space between the surrounding words and the dash. +* Ending a line with `--` will turn it into an em dash (`—`) and pull the following line upwards so there's a space between the surrounding words and the dash. From 3844f804b1136bac3af7d9fd7d80db5a7979a93c Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Wed, 25 Mar 2026 15:29:04 +0400 Subject: [PATCH 4/4] add a space before the em dash --- bikeshed/h/parser/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bikeshed/h/parser/parser.py b/bikeshed/h/parser/parser.py index 12a3ed4be4..e6386474cd 100644 --- a/bikeshed/h/parser/parser.py +++ b/bikeshed/h/parser/parser.py @@ -474,7 +474,7 @@ def parseNode( match, i, _ = s.matchRe(start, emdashRe) if match is not None: # Fix line-ending em dashes, or --, by moving the previous line up with an extra space. - node = RawText.fromStream(s, start, i, "— ") + node = RawText.fromStream(s, start, i, " — ") return Ok(node, i) if first1 in ("<", "&"):