tooling: accept empty fragments on Markdown file links #1602

Merged
nanyoudegege merged 1 commit from upstream-pr/1609 into main 2026-11-24 15:15:42 +00:00
nanyoudegege commented 2026-11-24 14:58:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by nanyoudegege on 2026-11-24T14:58:14Z.


Refs #1532, which left empty fragments as a follow-up.

[Top](Guide.md#) and a bare # point to the top of the target document, but the link checker treated the empty string as a missing heading. Check for a named heading only when the decoded fragment is nonempty, after validating the target path. Existing directory-fragment rules are unchanged. HTML standard

Verification (cloud Linux, Python 3.12.14, base e92566a):

  • In isolated tracked fixtures, the unmodified checker rejects empty file/document fragments and the patched checker accepts them. Across 22 independent cases, all 17 non-targeted results remained identical, including missing named headings, untracked files, and directory fragments. The added self-test fails when run with the original guard.
  • python3 -B tests/docs_links_check.py: passed, 16 Markdown files and 348 links.
  • python3 -B tests/bidi_controls_check.py: passed, 1,262 tracked files.
  • git diff --check: passed. No Windows, browser, or hardware tests run.

AI-assisted; independently rechecked on the current base.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6584685366 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1609). Originally posted by [nanyoudegege](https://github.com/nanyoudegege) on 2026-11-24T14:58:14Z. --- Refs #1532, which left empty fragments as a follow-up. `[Top](Guide.md#)` and a bare `#` point to the top of the target document, but the link checker treated the empty string as a missing heading. Check for a named heading only when the decoded fragment is nonempty, after validating the target path. Existing directory-fragment rules are unchanged. [HTML standard](https://html.spec.whatwg.org/multipage/browsing-the-web.html#select-the-indicated-part) **Verification** (cloud Linux, Python 3.12.14, base `e92566a`): - In isolated tracked fixtures, the unmodified checker rejects empty file/document fragments and the patched checker accepts them. Across 22 independent cases, all 17 non-targeted results remained identical, including missing named headings, untracked files, and directory fragments. The added self-test fails when run with the original guard. - `python3 -B tests/docs_links_check.py`: passed, 16 Markdown files and 348 links. - `python3 -B tests/bidi_controls_check.py`: passed, 1,262 tracked files. - `git diff --check`: passed. No Windows, browser, or hardware tests run. AI-assisted; independently rechecked on the current base.
chatgpt-codex-connector[bot commented 2026-11-24 15:02:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T14:58:30Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T15:00:52.537384Z 6eca98d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7135252856 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1609#issuecomment-7135252856). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T14:58:30Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"6eca98d7823233d746ff426cbf81274b0cba44fe","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T15:00:52.537384Z">2026-11-24T15:00:52.537384Z</relative-time> | `6eca98d` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
upstream-sync closed this pull request 2026-11-24 16:03:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1602
No description provided.