fix(resolution): retain JSX render links after child text

Merged
BO
2d ago
+13-10

JSX child components now keep their render links when plain text or a newline comes before the tag, such as <p>Sign in <Link /></p>.

The existing JSX lexer blanks child text while preserving offsets and line breaks. The tag classifier therefore no longer mistakes the preceding word for a type name. Type arguments, comments and quoted examples retain their existing false-positive controls.

The known-failure case becomes passing text/newline regressions, and the backtick fixture uses its natural Press `Ctrl` and <Kbd> text again. README, the framework guide, coverage notes and changelog describe the corrected behavior.

Validation: both new cases failed on the pre-fix source. The focused JSX, React Router import and kernel-golden suites passed 57/57; golden dumps unchanged. Svelte precision retained its known-absent edge (1/1). Test floor, agent-doc and whitespace guards passed. Full Node 24 suite passed: 726/726 files, 9,120 passed and 39 skipped. TypeScript/assets/viewer build and kernel-rule guard passed.

README “About this fork” rows checked: parsing/languages behavior updated; no language inventory or historical timing number changed. Related earlier JSX work: #501 and #504; this fixes the remaining plain-text child-tag case.


Summary by cubic

JSX child components now keep their render links when plain text or a newline precedes the tag, such as <p>Sign in <Link /></p>. Previously the word before the tag was misread as a type name or comparison, so the render link was dropped.

The JSX lexer now blanks child text while preserving offsets and line breaks, so the tag classifier recognizes the tag correctly. Type arguments, comments, and quoted examples keep their existing false-positive controls, and the previous known-failure test now passes with the natural backtick text.

Summary by CodeRabbit

  • Bug Fixes
    • JSX child components now retain render links when preceded by plain text, spaces, or line breaks.
    • JSX text, type arguments, comments, and quoted examples do not create unintended render links.
  • Documentation
    • Updated the guides and coverage notes to describe JSX child render-link behavior.