scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
https://scinfu.github.io/SwiftSoup/
MIT License
4.52k stars 345 forks source link

Is it possible to insert unencoded text to an Element? #185

Closed zhenyi closed 3 years ago

zhenyi commented 3 years ago

For example, if I try to do this:

scriptElement.html("if (a && b) { doThings(); }")

I will get:

<script>
if (a &amp;&amp; b) { doThings(); }
</script>

Instead of:

<script>
if (a && b) { doThings(); }
</script>

How do I set the innerHTML of an Element without encoding the content?