fix(javascript): reconstruct HTML script loads accurately (#1042)

* fix: parse HTML script references with HTML semantics

Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>

* test(javascript): cover exact HTML script resource identity

---------

Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
Co-authored-by: N0zoM1z0 <1705004398@qq.com>
This commit is contained in:
Rudy Mizrahi Celekli
2026-10-08 01:24:24 -04:00
committed by GitHub
parent 53409ab196
commit 1154f2f03c
11 changed files with 475 additions and 22 deletions
@@ -93,6 +93,17 @@ const resolvePackagePath = (
if (typeof candidate !== "string") return candidate;
const confined = confineCandidate(input, candidate);
if (typeof confined !== "string") return confined;
if (input.context === "html-reference")
return outcome(
input,
resolveFileCandidates(input, [confined]) ?? {
resolvedPath: null,
status: "not-found",
limitations: [
`The exact HTML resource ${confined} was not found among the selected application files.`,
],
},
);
const resolved =
mode === "files-and-index"
? (resolveFileCandidates(input, [