Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to use Document.parseHTMLUnsafe instead of DOMParser for parsing HTML? #2682

Open
lukewarlow opened this issue Jun 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@lukewarlow
Copy link

Currently HTMX is using new DOMParser().parseFromString() for parsing the HTML responses. This is fine enough for most use cases and makes sense given the browser support is better.

However, one big limitation of this is it doesn't support Declarative Shadow DOM. For this there's a newer Document.parseHTMLUnsafe() function.

Would it make sense to provide a mechanism to use the newer function?

@lukewarlow
Copy link
Author

Just to note the unsafe naming is there because in future we'll get a "safe" version (called parseHTML that has a built in sanitiser and all that nice stuff), so parseHTMLUnsafe is no less safe than parseFromString.

@Telroshan Telroshan added the enhancement New feature or request label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants