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

HTMLKit erroneous HTMLText serialization and entity decoding #16

Closed
dsanghan opened this issue Nov 6, 2017 · 2 comments
Closed

HTMLKit erroneous HTMLText serialization and entity decoding #16

dsanghan opened this issue Nov 6, 2017 · 2 comments
Assignees
Labels

Comments

@dsanghan
Copy link

dsanghan commented Nov 6, 2017

Let's say you have the following html:

<html>
  <body>
    <div> &lt;example&gt; </div>
  </body>
</html>

Then on:

HTMLDocument *doc = [HTMLDocument documentWithString:html];

and printing out the html via doc.rootElement.outerHTML you get partially decoded entities:
<html><head></head><body> <div>&lt;example></div> </body></html> where &lt; is left as is, and &gt; is decoded.

Not sure what the correct thing to do here is.

@iabudiab
Copy link
Owner

iabudiab commented Nov 6, 2017

@dsanghan Hey there! I'll take a look at this as soon as I get home. I'll keep you posted.

@iabudiab iabudiab changed the title HTMLKit html entity decoding HTMLKit erroneous HTML serialization and entity decoding Nov 6, 2017
@iabudiab iabudiab self-assigned this Nov 6, 2017
@iabudiab iabudiab added the bug label Nov 6, 2017
@iabudiab
Copy link
Owner

iabudiab commented Nov 6, 2017

@dsanghan Hey again! It's a 🐛 But don't worry, I've already fixed it and a new version is being released. Thanks a lot for reporting this 👍

I've also revisited all the other serialization methods and guess what? HTMLElement suffers from the same bug.

I'll close this once the code is pushed and released.

@iabudiab iabudiab changed the title HTMLKit erroneous HTML serialization and entity decoding HTMLKit erroneous HTMLText serialization and entity decoding Nov 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants