Skip to content

[Bug]: Bespoke Markdown readers disagree on fences and skip titled links #1118

Closed

Description

@jimhoyd

Runtime revision and environment

Read-only bespoke-functionality audit of main 96543b7, Node 26.10.0, macOS. Two synthetic probes reproduced; no production incident claimed.

Minimal reproduction

  1. Run scripts/check-local-links.ts with an authored Markdown file containing:
[Broken](./__nonexistent_bespoke_audit__.md "a title")

The checker exits 0 with no dead target. The inline-link regex at scripts/check-local-links.ts:181 accepts only a target immediately followed by a closing parenthesis, so valid titled links escape checking. Angle-bracket destinations and balanced parentheses need explicit coverage too; those were not independently exercised in this probe.

  1. Give markdownAnchors and docs-search.ts:headingsOf the same lines: an opening triple-backtick text fence, a line with four spaces followed by triple backticks, "# still inside code", an unindented closing triple-backtick fence, then "# Real". markdownAnchors returns only "still-inside-code"; headingsOf correctly returns "Real". The local-link parser trims indentation before testing a closing fence, whereas docs search respects the three-space limit.

Relevant output

Link-check probe: exit 0; "no retired-repository, dead or dead-fragment targets."
Fence probe: linkChecker=["still-inside-code"], docsSearch=["Real"].

This is fresh evidence of duplicated Markdown semantics, related to the already-fixed docs-search #826. check-doc-yaml.ts and check-guidance-claims.ts also maintain separate fence readers and should be checked against the same cases; no claim that every reader has the identical bug.

Fix link discovery and reconcile shared fence semantics with focused fixtures. Retain repository-specific historical exemptions, release-pinned links and shipped-path rules. #1044/#1041 already rejected a full third-party link-checker stack on dependency cost; this issue does not prescribe reintroducing that stack. Consider a small shared parser/helper or narrowly selected parser dependency with measured total cost.

Activity

  1. jimhoyd commented on Oct 1, 2026

    @jimhoyd
    CollaboratorAuthor

    Taking this: Issues [37f079]

  2. added
    bug
    in-progress
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugin-progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions