Update parseHTML to use Document.parseHTMLUnsafe where supported#3185
Conversation
|
Not sure how best to test this? |
|
You can compare specs at https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring and https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe These should be identical behaviour wise, except perhaps for the URL setting of the resultant document but I don't believe that's an issue for HTMX's use case. |
|
|
|
I support this! |
|
@MichaelWest22 is going to put this behind a config flag to ensure no semantic changes for existing users. Thank you! |
Description
Updates parseHTML to use Document.parseHTMLUnsafe where supported
This allows HTMX to support declarative shadow dom
Corresponding issue: #2682
Testing
Please explain how you tested this change manually, and, if applicable, what new tests you added. If
you're making a change to just the website, you can omit this section.
Checklist
masterfor website changes,devforsource changes)
approved via an issue
npm run test) and verified that it succeeded