-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: escape unsafe patterns in elements, comment nodes and processing instructions #18
Conversation
113c586
to
ad21ca6
Compare
c3bcd83
to
1c8f504
Compare
17d7f15
to
e4e1c95
Compare
aa16603
to
9bf2b98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for putting this up!
ff6f266
to
8f25adc
Compare
@securityMB thanks for the review 👍 FYI I've used your recommendation and also added tests for escaping util functions (in ab8ff69), so it's easier to extend the coverage if needed. |
8f25adc
to
ab8ff69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some performance related observations. (Totally optional)
… instructions This commit updates the logic to espace unsafe patterns: - for elements that can have raw text: all matching closing tags are escaped - for comment nodes: all closing comment tags are escaped - for processing instructions: all `>` symbols are excaped
ab8ff69
to
4f8a2dd
Compare
@alan-agius4 thanks for reviewing, I've applied the necessary changes. |
This commit updates the logic to espace unsafe patterns:
>
symbols are escaped