scinfu/SwiftSoup

Parsing html with iframe inserts stray escaped elements into Document

Closed this issue · 0 comments

SwiftSoup appears to insert escaped nodes when parsing html that contains an iframe.

For example:

let html = "<html><body><iframe src=\"http://www.example.com\" /></body></html>"

let dirty = try! SwiftSoup.parse(html)
print(try! dirty.html())        

Will output:

<html>
 <head></head>
 <body>
  <iframe src="http://www.example.com"></iframe>&lt;/body&gt;&lt;/html&gt;
 </body>
</html>

I'd expect it to output:

<html>
 <head></head>
 <body>
  <iframe src="http://www.example.com"></iframe>
 </body>
</html>