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

sanitize fails at invalid html #370

Open
Tiggerito opened this issue Sep 19, 2020 · 0 comments
Open

sanitize fails at invalid html #370

Tiggerito opened this issue Sep 19, 2020 · 0 comments

Comments

@Tiggerito
Copy link

I've been using the sanitize helper in BigCommerce to get clean text from html. We just encountered an error that I've narrowed down to an issue with handling invalid html.

Example input:

<p>
before bug<img test"="">after bug
</p>

I've added a deliberate mistake with the syntax of the img attribute, adding a random double quote.

This causes the sanitize to stop at that syntax error and only output text from before it. e.g. "before bug".

It would be nicer if it was more robust.

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

No branches or pull requests

1 participant