mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
1f36a9cee0
The HTML parser treats </script> (and </style>) as the end of the containing element regardless of JavaScript/CSS string context. When dangerouslySetInnerHTML content contained these sequences, the SSR output could produce malformed HTML where the tag boundary was broken. Add escapeInlineContent() that replaces </script and </style with <\/script and <\/style (case-insensitive). Apply it in: - next/script: beforeInteractive SSR path - next/head: reactElementToHTML for script and style tags Includes 14 tests covering the escaping helper, Script component SSR, and Head component SSR.