-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
use DOMParse in pasteHTML to protect against dangerous html #990
Conversation
Only tested with Firefox 48. |
It seems to have not passed the unit test for Chrome+Firefox on all operating systems. |
@is it possible that it's something specific to the tests? Testing with this PR produce the correct delta when using: quill.pasteHTML('<p class="ql-align-center">Test</p>'); or <div class="standalone-container">
<div id="snow-container"><p class="ql-align-center">Test</p></div>
</div> Assuming that it'll work, do you want to use DOMParser or close the PR? I'm not using pasteHTML myself. I created this PR to help with the discussion. |
If DOMParser works without issue it would be a good idea to use it. I do not want to rename back to pasteHTML though. I want to set the expectation that the HTML you hand Quill should already be safe, and while Quill should do things safely itself, it is not the security solution to unsafe input. |
Do you have a suggestion about the failing tests? |
It looks like the reason is |
I see. This example gives me: |
In light of this I'm not seeing a way to use DOMParser. |
Thanks |
fix #981