Replace substring `html.replace(old_src, new_src)` with a regex anchored to <script src="…"> / <link href="…"> attribute values. Inert occurrences in comments, JSON literals, or unrelated attributes are left alone. Loud warning (stderr) when zero matches occur — previously the script silently skipped a typo'd old_src. Also rewrites <link href> in the same pass so adjacent CSS hashing doesn't need a follow-up edit. Tests: tests/test_inject_hashed_filenames.py covers happy path (both quote styles, extra attributes), inert-substring cases (comment, JSON literal, data-attr, anchor href), and link-href rewriting. Closes #3 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5.2 KiB
5.2 KiB