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

M3-4452 Upgrade sanitize-html #6839

Merged

Conversation

johnwcallahan
Copy link
Contributor

@johnwcallahan johnwcallahan commented Aug 31, 2020

Description

Previously there was an issue where some HTML tags were removed instead of escaped, which led to confusing support ticket bodies (see ticket for more details). This was happening even though we have sanitize-html set to "escape".

It looks like this was a bug in that library. Upgrading the library fixed the issue, with no regressions as far as I can tell.

Note to Reviewers

As a simple example, in production: entering <input /> in the Support Ticket Reply box will yield an empty Preview tab. In this branch, you'll see <input /> in the Preview tab, properly escaped behind the scenes.

Note: there is still some confusing behavior in the library which @acourdavault opened an issue about here: apostrophecms/sanitize-html#334. As an example, <input> yields <input /> (self-closed). This isn't ideal, but not a deal-breaker IMO.

@johnwcallahan johnwcallahan self-assigned this Aug 31, 2020
Copy link
Contributor

@Jskobos Jskobos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my old gotcha ticket replies are still escaped properly, I think we're good.

@johnwcallahan johnwcallahan merged commit 373dc06 into linode:develop Sep 1, 2020
@johnwcallahan johnwcallahan deleted the M3-4452-support-ticket-HTML branch September 1, 2020 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants