cure53 / DOMPurify

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
https://cure53.de/purify
Other
13.34k stars 690 forks source link

refac: refactoring nodeType by adding a NODE_TYPE object #948

Closed ssi02014 closed 2 months ago

ssi02014 commented 2 months ago

Summary

Hi! 👋 @cure53 It seems that there is a very slight inconvenience in understanding the code because nodeType is currently compared by numbers.

I'm hoping that by adding a NODE_TYPE object, we can provide more readable code!

ENTITY_REFERENCE_NODE(5), ENTITY_NODE(6), and NOTATION_NODE(7) are deprecated, but I've added all of them.

MDN-NodeType

cure53 commented 2 months ago

Oh, nice, I like that idea, thank you! Would you mind re-sending the PR? We worked on stuff in the meantime and don't want to clear the conflicts manually :stuck_out_tongue: Thanks!

ssi02014 commented 2 months ago

Oh, nice, I like that idea, thank you! Would you mind re-sending the PR? We worked on stuff in the meantime and don't want to clear the conflicts manually 😛 Thanks!

@cure53 Of course! I have updated and committed again. Thank you! 🤗

cure53 commented 2 months ago

Epic, thank you :slightly_smiling_face: