Skip to content

Make canContain return true for <table>, <thead>, <tbody>, <tfoot> an… #134

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

Closed
wants to merge 1 commit into from

Conversation

topcoderKai
Copy link

Make canContain return true for <table>, <thead>, <tbody>, <tfoot> and <tr> elements,
so that it will not close the open table elements and break table layout.

…d <tr> elements,

so that it will not close the open table elements and break table layout.
@@ -313,7 +313,7 @@ public static final void testScriptInTable() {
.and(Sanitizers.STYLES)
.and(Sanitizers.IMAGES)
.and(Sanitizers.TABLES);
assertEquals("<table></table>Hallo\r\n\nEnde\n\r", pf.sanitize(input));
assertEquals("<table>Hallo\r\n\nEnde\n\r</table>", pf.sanitize(input));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this a better behavior?

@mikesamuel
Copy link
Contributor

Thanks for the patch.

I think 66794b6 addresses this.

@mikesamuel mikesamuel closed this Oct 12, 2019
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.

2 participants