Skip to content

Conversation

@mceachen
Copy link

@mceachen mceachen commented Jan 8, 2026

Use control characters (\x01, \x02) as placeholders instead of <!...!> which Prettier v3's stricter HTML parser rejects inside attributes.

I then found that Prettier was mucking with some EJS constructs -- so to avoid that, we're replacing the EJS with a placeholder value -- but you have to be careful to have your placeholder be exactly the same characters long, or Bad Things happen.

Use control characters (\x01, \x02) as placeholders instead of <!...!> which Prettier v3's stricter HTML parser rejects inside attributes.
BREAKING CHANGE: Requires Prettier 3.x (import path changed from `prettier/parser-html` to `prettier/plugins/html`)

Use length-preserving placeholders to completely hide EJS content from prettier, and prevent AST parser getting confused. like from `<input <%= foo ? 'checked' : '' %> />`.

Fixes ecmel#11
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