Skip to content

HTML syntax fixes#6487

Merged
laurmaedje merged 6 commits intomainfrom
html-syntax-fixes
Jun 23, 2025
Merged

HTML syntax fixes#6487
laurmaedje merged 6 commits intomainfrom
html-syntax-fixes

Conversation

@laurmaedje
Copy link
Member

@laurmaedje laurmaedje commented Jun 23, 2025

Main changes:

  • Fixes encoding of pre elements that start with a newline
  • Properly handles raw text elements (<script> and <style>) by not writing escape sequences. When a closing tag is detected in the text, the export errors as there is no way to encode it. When pretty-printing is enabled, the contents of the raw text element are only indented if we are sure it's JS/CSS (no type attr telling us something else) and, in the case of JS, if there are no backticks in it because the semantics of multiline template string literal could be changed by indent.

Infrastructure-wise, this PR adds support for HTML export errors in the test runner and also cleans up a few error messages. The PR is best looked at commit-by-commit and will be merged without squash.

@laurmaedje laurmaedje merged commit bf8ef2a into main Jun 23, 2025
14 checks passed
@laurmaedje laurmaedje deleted the html-syntax-fixes branch June 23, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant