Closed bcardarella closed 2 years ago
If I do the following:
Parser.parseFragment("<div>Hello, world!</div>", nil, "")
I get an resulting fragment with html of:
<html> <head></head> <body> <div>Hello, world!</div> </body> </html>
whereas I want to preserve the actual fragment of just : <div>Hello, world!</div> and not wrap in additional tags. How best can I go about this?
<div>Hello, world!</div>
Hi @bcardarella 👋🏻 Try to use var html = try document.body()?.html() to avoid additional tags wrapping.
var html = try document.body()?.html()
If I do the following:
I get an resulting fragment with html of:
whereas I want to preserve the actual fragment of just :
<div>Hello, world!</div>
and not wrap in additional tags. How best can I go about this?