tags:

views:

220

answers:

1

Hi, I'm trying to add a bunch of html to an existing nodeset, at the top. It mostly works, but the style tags and script tags are getting scrubbed of their content. Here's what I mean:

doc.xpath("//head/*[1]").before("<script>var xb=25</script>")

But if I try to display this, this is what I get:

hdoc.xpath("//head/*[1]")
=> <script></script>

It is scrubbing everything in between script and style tags, and ignores html comments altogether. Any ideas how to avoid this?

+1  A: 

Current Nokogiri master fixes this issue.

Mike Dalessio