Commit Graph

2 Commits

Author SHA1 Message Date
BFlat 5185f36ab0 Import maps, speculation rules and data blocks aren't read as JavaScript (#353)
The HTML scanner skipped only `<script>` bodies whose type mentioned "json" or "template". Import maps (`importmap`), speculation rules (`speculationrules`) and data blocks such as `text/html` became JavaScript modules in app maps: an import map was reported as a broken script, and an inert HTML template could add made-up fetch endpoints.

A `<script>` now counts as a script only when the page runs it as code: no type, `module`, or a JavaScript MIME type (parameters such as `; charset=…` are ignored), plus `text/babel` and `text/jsx`, which in-browser Babel runs. Other types are left out, both inline and with `src`.

**Verified:** a new scanner test. Five non-JavaScript types (inline and with `src`) give no scripts; six JavaScript spellings, including a mixed-case type and one with a charset, give one each. `cargo test -p craft-anything-js` (41) and `-p craft-anything-analysis` (85), clippy and fmt pass.

**Not run:** `cargo xtask wasm`. The change is pure string logic in an existing function.

Fixes #285
2026-11-02 15:42:22 +07:00
Brandon Thomas f64ae3bf3c Craft Anything
A native, pure-Rust app that shows anyone how a piece of software works, with
evidence-backed answers, then helps them rebuild it. It ships a desktop app, a
CLI and an MCP server, all driven by one engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 10:52:14 -04:00