Repository navigation
fix(deps): place asset tags only at the page's real </head> and </body>; release citry 1.1.0 - #806
Merged
Merged
Conversation
Read the HTML with the browser's tokenizer rules to find where CSS and JS go, so end-tag text inside an attribute value, comment or raw text is not taken for the tag. Matching ignores letter case. Where the reading depends on the surrounding element, only positions every reading agrees on are used; otherwise the tags go at the start or end. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHaXagmW5ZxpRAMwyom
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHaXagmW5ZxpRAMwyom
Track the SVG and MathML elements a reading is inside, where <script> and <style> are ordinary elements, and read raw text both ways wherever that tracking is unreliable. Bound the scan's work so it stays linear, and skip simple SVG blocks in one step. Place runtime preload hints only at the </head> the scan agrees on. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHaXagmW5ZxpRAMwyom
…nd template elements Inside SVG and MathML, take a tag as self-closing without the slower exact check only when all its attribute values are quoted or missing, since in "x= />" the "/" belongs to the value. Track open <select> and <template> elements so the page is read as plain HTML again after they close, and read <script> both ways inside them (template content that starts with <col> ignores it). Stop tracking past 256 open SVG elements or 64 open select and template elements, and skip SVG and MathML elements nested up to two levels in one step. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHaXagmW5ZxpRAMwyom
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHaXagmW5ZxpRAMwyom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Opus 5.5)
What changed
</head>or</body>element, in any letter case. A new scanner (citry/util/_tag_scan.py) skips attribute values, comments and script text, and follows SVG, MathML,<select>and<template>. When a page could be read more than one way, a position is used only if every reading agrees; otherwise CSS goes at the start and JS at the end of the output. Runtime preload hints follow the same rule.Checks
main), plus 24 browser tests in Chromium, Firefox and WebKit.main. ruff and mypy (also--platform linux) clean.Versioning
citry 1.1.0 is a minor release: it also ships the Experimental APIs merged in #800, #801, #802, #803 and #805, and the fix from #799. The placement change keeps tags where they were on ordinary pages.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KUhrHaXagmW5ZxpRAMwyom