From 05f310ec6b8ff56bd83047b668c9183708d58d36 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Mon, 30 Nov 2026 09:30:40 -0500 Subject: [PATCH 1/4] fix(product-development): keep code span text in heading anchors slug() stripped HTML tags and emphasis across the whole heading, so a code span such as `Promise` or `__init__` lost text that GitHub keeps, and a valid Blocks target naming that heading failed validation. Code spans now keep their text as written; link, tag and emphasis stripping applies only to the prose around them. Refs #37, #35 --- .../scripts/open-questions.py | 17 +++++++++++++---- .../tests/open-questions.bats | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/plugins/product-development/skills/product-development/scripts/open-questions.py b/plugins/product-development/skills/product-development/scripts/open-questions.py index 813d9ba..66146d7 100755 --- a/plugins/product-development/skills/product-development/scripts/open-questions.py +++ b/plugins/product-development/skills/product-development/scripts/open-questions.py @@ -321,10 +321,19 @@ def inline(match): def slug(heading): """A heading's anchor as GitHub generates it: from the rendered text, so link targets, HTML tags and emphasis markers drop out, while underscores - inside words stay.""" - text = re.sub(r"!?\[([^\]]*)\]\([^)]*\)", r"\1", heading.strip()) - text = re.sub(r"<[^>]+>", "", text) - text = re.sub(r"(?]+>", "", prose) + return re.sub(r"(?` and _care_/' "$B/roadmap.md" + sed -i.bak 's/roadmap.md#invitation-extension/roadmap.md#call-__init__-with-promiseresult-and-care/' "$B/open-questions.md" + rm "$B/roadmap.md.bak" "$B/open-questions.md.bak" + run "$OQ" index "$B" + [ "$status" -eq 0 ] || { echo "status $status: $output" >&2; return 1; } + run "$OQ" check "$B" + [ "$status" -eq 0 ] || { echo "status $status: $output" >&2; return 1; } + run "$OQ" blocking "$B" roadmap.md#call-__init__-with-promiseresult-and-care --level release + [ "$status" -eq 1 ] + [[ "$output" == *"open-questions.md#oq-2 release"* ]] +} + @test "a Blocks target naming a missing document fails the check" { sed -i.bak 's/| roadmap.md#invitation-extension |/| rollout-plan.md#invitation-extension |/' "$B/open-questions.md" rm "$B/open-questions.md.bak" From 9c725017c2e197eca254122e06d5bc9b4af693d5 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Mon, 30 Nov 2026 09:32:20 -0500 Subject: [PATCH 2/4] fix(product-development): keep links and emphasis that wrap code in anchors Splitting the heading at code spans broke a link or emphasis that wraps code: [`npm install`](url) leaked its URL into the anchor, and _the `cache` key_ kept its underscores. slug() now holds each code span behind a placeholder, strips links, tags and emphasis from the whole heading, and then restores the code text. A table test covers the heading shapes the review listed. Refs #37, #35 --- .../scripts/open-questions.py | 24 +++++++++-------- .../tests/open-questions.bats | 26 +++++++++++++++++++ 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/plugins/product-development/skills/product-development/scripts/open-questions.py b/plugins/product-development/skills/product-development/scripts/open-questions.py index 66146d7..87a2343 100755 --- a/plugins/product-development/skills/product-development/scripts/open-questions.py +++ b/plugins/product-development/skills/product-development/scripts/open-questions.py @@ -323,17 +323,19 @@ def slug(heading): link targets, HTML tags and emphasis markers drop out, while underscores inside words stay. A code span keeps its text as written.""" - def rendered(prose): - prose = re.sub(r"!?\[([^\]]*)\]\([^)]*\)", r"\1", prose) - prose = re.sub(r"<[^>]+>", "", prose) - return re.sub(r"(?]+>", "", text) + text = re.sub(r"(?Enter": "enter", + "Call `__init__` with `Promise`": "call-__init__-with-promiseresult", + "``Promise``": "promiseresult", + "Use [`npm install`](https://example.com)": "use-npm-install", + "Use _the `cache` key_": "use-the-cache-key", + "Use __the `cache` key__": "use-the-cache-key", +} +bad = [(h, oq.slug(h), want) for h, want in cases.items() if oq.slug(h) != want] +print(bad) +sys.exit(1 if bad else 0) +PY + [ "$status" -eq 0 ] || { echo "$output" >&2; return 1; } +} From 33d3a58ca52ace6c32e452a618c4cb57a21da37c Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Mon, 30 Nov 2026 09:34:06 -0500 Subject: [PATCH 3/4] fix(product-development): treat comparison operators in headings as text The HTML tag pattern in slug() matched from any "<" to the next ">", so a heading such as "What if `count` < `min` or `count` > `max`?" lost everything between the operators, code included, and a link to its real anchor failed. Only real tags, with a letter or "/" right after "<", are stripped now. The anchor table gains comparison and tagged-attribute cases. Refs #37, #35 --- .../skills/product-development/scripts/open-questions.py | 4 +++- .../skills/product-development/tests/open-questions.bats | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/product-development/skills/product-development/scripts/open-questions.py b/plugins/product-development/skills/product-development/scripts/open-questions.py index 87a2343..a4d05a7 100755 --- a/plugins/product-development/skills/product-development/scripts/open-questions.py +++ b/plugins/product-development/skills/product-development/scripts/open-questions.py @@ -333,7 +333,9 @@ def hold(match): text = re.sub(r"(`+)(.+?)\1", hold, heading.strip()) text = re.sub(r"!?\[([^\]]*)\]\([^)]*\)", r"\1", text) - text = re.sub(r"<[^>]+>", "", text) + # Only real tags: a letter or "/" right after "<", so a comparison such as + # "a < b and c > d" is text, not a tag. + text = re.sub(r"\x00]*)?/?>", "", text) text = re.sub(r"(?Enter": "enter", "Call `__init__` with `Promise`": "call-__init__-with-promiseresult", "``Promise``": "promiseresult", + "What if `count` < `min` or `count` > `max`?": "what-if-count--min-or-count--max", + "Keep a < b and c > d": "keep-a--b-and-c--d", + "A tagged word": "a-tagged-word", "Use [`npm install`](https://example.com)": "use-npm-install", "Use _the `cache` key_": "use-the-cache-key", "Use __the `cache` key__": "use-the-cache-key", From 1c58b4da483c2d127b4c2af4092f91c4c6952c19 Mon Sep 17 00:00:00 2001 From: John Lianoglou Date: Mon, 30 Nov 2026 09:37:20 -0500 Subject: [PATCH 4/4] fix(product-development): strip tags whole and match code fences exactly in anchors From CodeRabbit's review of the heading-anchor fix: a backtick inside an HTML attribute left the tag in the anchor, because the tag pattern stopped at the code placeholder. Tags now go whole, attributes included. HTML comments drop out. Escaped backticks are text, and a code span needs opening and closing backtick runs of the same length. The anchor table gains a case for each. Refs #37, #35 --- .../product-development/scripts/open-questions.py | 11 ++++++++--- .../product-development/tests/open-questions.bats | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/plugins/product-development/skills/product-development/scripts/open-questions.py b/plugins/product-development/skills/product-development/scripts/open-questions.py index a4d05a7..78493ec 100755 --- a/plugins/product-development/skills/product-development/scripts/open-questions.py +++ b/plugins/product-development/skills/product-development/scripts/open-questions.py @@ -331,11 +331,16 @@ def hold(match): code.append(match.group(2)) return f"\x00{len(code) - 1}\x00" - text = re.sub(r"(`+)(.+?)\1", hold, heading.strip()) + # An escaped backtick is text, not a code fence. A code span opens and + # closes with backtick runs of the same length. + text = heading.strip().replace("\\`", "\x01") + text = re.sub(r"(?", "", text) # Only real tags: a letter or "/" right after "<", so a comparison such as - # "a < b and c > d" is text, not a tag. - text = re.sub(r"\x00]*)?/?>", "", text) + # "a < b and c > d" is text, not a tag. A tag goes whole, attributes and + # any backticks inside them included. + text = re.sub(r"]*)?/?>", "", text) text = re.sub(r"(? `max`?": "what-if-count--min-or-count--max", "Keep a < b and c > d": "keep-a--b-and-c--d", "A tagged word": "a-tagged-word", + "Run now": "run-now", + "Call _`run`_": "call-run", + "Call [`run`](guide.md)": "call-run", + "Step one": "step--one", + "Escaped \\`tick\\` stays": "escaped-tick-stays", + "Run ``a `b` c`` now": "run-a-b-c-now", + "Odd `a`` runs": "odd-a-runs", "Use [`npm install`](https://example.com)": "use-npm-install", "Use _the `cache` key_": "use-the-cache-key", "Use __the `cache` key__": "use-the-cache-key",