mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-25 16:37:32 +00:00
* fix(studio-server): place the preview variables tag by reading the document The tag that carries `?variables=` into a preview was placed after the first "<head" text in the file. That text can also sit inside an attribute value or a comment, and a tag placed there is not a script: the page got no variables and the <html> element picked up extra attributes. core gains headContentStart, built on the tokenizer helpers htmlDocument already has. It reads the document prefix the way a browser does (comments, doctype, quoted attribute values) and returns the position after the real <head> start tag, else after <html>, else after the doctype, else 0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(studio-server): place the GSAP fallback script by reading the document The preview route put this script after the first literal "<head>" in the page, which can be text inside an attribute value or a comment. It now uses headContentStart, the same as the preview variables tag. A page whose head tag has attributes also gets the script inside the head now, where before it went ahead of the doctype. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(core): headContentStart keeps a leading byte-order mark first With no doctype, html or head tag the position was 0, ahead of the mark. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * chore(core): trim comments added with head placement Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>