mirror of
https://github.com/storytold/craft-anything.git
synced 2026-11-05 20:47:45 +01:00
4ae6ce70d2
An inline `<script>` becomes a module of its own (`index.html#inline-0`). Its summary took its hash from the input file with the same path, and there is no such file, so the hash was always empty. Comparing two maps then read "both empty" as "the same", and an edited inline script counted as unchanged.
- **Inline scripts now get the hash of their own code.**
- **Maps saved before this have no hash for them.** Where either side lacks a hash, the comparison now checks the module's structure fingerprint, size and strings instead.
**Verified:** a new test with a page whose inline script changes from `console.log("A")` to `("B")`:
- the inline module and the page are reported changed, and a map compared with itself has two unchanged modules;
- the same holds for maps with the inline hashes blanked, as saved before this fix.
`cargo test -p craft-anything-analysis` (80), the engine's app tests (31), clippy and fmt pass.
Fixes #236