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

Remove invalid end tags for empty elements (RT120384) #16

Merged
merged 2 commits into from Jun 25, 2017

Conversation

Projects
None yet
2 participants
@paultcochrane
Contributor

paultcochrane commented Jun 23, 2017

This pull request fixes the issue mentioned in RT#120384, whereby end tags for empty elements were allowed in the output (such things are invalid HTML). A small change needed to be made to the expectation in the test of XHTML behaviour (t/rt19063_xhtml.t) so that such invalid elements are missing from the expected output. This change makes the scrubbed output more compatible with the HTML specification, but possibly makes the scrubbed output stricter than desired.

If you have any questions or comments about this PR, please don't hesitate to contact me! If the patch needs updating in any way, just let me know and I'll fix and resubmit as appropriate.

paultcochrane added some commits Jun 23, 2017

Remove invalid end tags
... which solves the issue reported in RT#120384, namely that end tags
of empty elements (e.g. </br>, </hr>, </img>, etc.) are invalid HTML and
should be removed from the scrubbed output.
Update test expectation when scrubbing xhtml
... so that invalid closing tags on empty elements are removed from the
scrubbed output.

@nigelm nigelm merged commit 39b1159 into nigelm:master Jun 25, 2017

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@nigelm

This comment has been minimized.

Show comment
Hide comment
@nigelm

nigelm Jun 27, 2017

Owner

Thanks for this and the previous series of PRs. I've had a dev version of HTML::Scrubber out for a couple of days and nothing has come up on the CPANTS smokers, so I'll push a release version out now.

Contributions were much appreciated.

Owner

nigelm commented Jun 27, 2017

Thanks for this and the previous series of PRs. I've had a dev version of HTML::Scrubber out for a couple of days and nothing has come up on the CPANTS smokers, so I'll push a release version out now.

Contributions were much appreciated.

@paultcochrane

This comment has been minimized.

Show comment
Hide comment
@paultcochrane

paultcochrane Jun 28, 2017

Contributor

My pleasure! Glad to have been able to make a contribution. Thanks for merging the PRs :-)

Contributor

paultcochrane commented Jun 28, 2017

My pleasure! Glad to have been able to make a contribution. Thanks for merging the PRs :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment