feat(html): keep special chars in attrs as-is when possible#19396
feat(html): keep special chars in attrs as-is when possible#19396sapphi-red wants to merge 3 commits intovitejs:mainfrom
Conversation
patak-cat
left a comment
There was a problem hiding this comment.
this looks good to me to help projects move to Vite 6, we can still decide later on to revert and do a full escape in a future major.
|
I don't think '&' should be escaped.
please do not manipulate user input, just ensure the value does not break out of the double quotes. |
If the user passed that value, Vite treats that that value should be the result interpreted by the browsers (or other HTML interpreters) rather than that value should be written in the HTML. If the plugin cares about the output content rather than the value interpreted, the plugin can still return a string in
That is true, but only escaping
|
|
I understand that but while it would be inconsistent if a user tried to do both approaches in the same project, it’s overall not inconsistent when you consider that 2 different users could use the 2 different ways “consistently” in their respective codebases. With this implementation you are disallowing User1 methodology altogether, and is my belief that it should not be a vite decision to enforce one way or the other. |
|
any update ? |
Description
close #18811
refs #18067