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

bug: closing tag for </html> misplaced #285

Open
woodpexer opened this issue Jun 27, 2023 · 1 comment
Open

bug: closing tag for </html> misplaced #285

woodpexer opened this issue Jun 27, 2023 · 1 comment

Comments

@woodpexer
Copy link

woodpexer commented Jun 27, 2023

issue is

The following block is my input:

<html><hr><br><div style="font-weight:bold;">aaaaaaaa</div>
<div>bbbbbbbbb.</div>
<div>dddddddddd <u>dddd</u> ddddd</div>
</html>

And the following is my output:

<html></html><hr /><br /><div style="font-weight:bold">aaaaaaaa</div>
<div>bbbbbbbbb.</div>
<div>dddddddddd <u>dddd</u> ddddd</div>

Bug

As can be seen at the end of my input the closing tag is being moved by the sanitizer right to its starting tag in the output.

This is my policy

new HtmlPolicyBuilder()
            .allowStandardUrlProtocols()
            .allowElements("a", "hr", "br", "div", "u")
            .allowElements("html")
            .allowStyling()
            .toFactory();

not part of the issue

Just by the way: is it possible to turn off the conversion of single opened tags into closed tags like for example:

  • from <hr> to <hr />
  • from <br> to <br />

Kind regards

@woodpexer woodpexer changed the title bug: closing tag for <html> misplaced bug: closing tag for </html> misplaced Jun 27, 2023
@Jagannathmaity110
Copy link

Can I work on this issue??

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

2 participants