style(extract): trim inline comments on the #4860 import fix

(cherry picked from commit decd4b99de)
This commit is contained in:
jitendarmahara authored and safishamsi committed 2026-10-30 22:41:50 +00:00
1 parent fe55ad7cac
commit 3ca53c70ac
2 files changed
+1 -8

No files matched your search

+1 -3
View File
@@ -866,9 +866,7 @@ def _resolve_js_module_path(raw: str | Path, start_dir: Path | None = None) -> P
if start_dir is None:
return _resolve_js_import_path(Path(raw))
if raw.startswith("."):
# Strip a cache-busting query / fragment (`./foo.js?v=1`, `./foo.js#frag`)
# before resolving, mirroring the Markdown extractor (#4860). Browsers and
# bundlers resolve the module as if the suffix were absent.
# Strip ?query / #fragment before resolving, as bundlers do (#4860).
specifier = raw.split("#", 1)[0].split("?", 1)[0]
return _resolve_js_import_path(start_dir / specifier)
@@ -353,11 +353,6 @@ def test_named_imports_emit_symbol_edges_after_resolution(tmp_path):
# ── #4860 — relative specifiers with a ?query / #fragment suffix ─────────────
# A cache-busting query (`./foo.js?v=123`) or fragment (`./foo.js#frag`) on a
# relative specifier must be stripped before resolution, exactly as browsers
# and bundlers do and as the Markdown extractor already does (markdown.py).
# Before the fix, `start_dir / raw` kept the suffix, so the file never resolved
# and a phantom `ref_..._v_...` node took the edge instead.
def test_resolve_relative_specifier_with_query_string(tmp_path):