Skip to content

Instantly share code, notes, and snippets.

@stringbot
Created May 12, 2009 17:02
Show Gist options
  • Save stringbot/110599 to your computer and use it in GitHub Desktop.
Save stringbot/110599 to your computer and use it in GitHub Desktop.
Warszawa:Desktop josh$ irb
>> require 'hpricot'
=> true
>> html = "<html>
<textarea><iframe></iframe></textarea>
</html>"
=> "<html>\n<textarea><iframe></iframe></textarea>\n</html>"
>> Hpricot(html)/'textarea'
=> #<Hpricot::Elements[{emptyelem <textarea>}]>
>> Hpricot(html)
=> #<Hpricot::Doc {elem <html> "\n" {emptyelem <textarea>} {emptyelem <iframe>} {bogusetag </textarea>} "\n" </html>}>
In 0.6.x you would get:
>> Hpricot(html)/"textarea"
=> #<Hpricot::Elements[{elem <textarea> {emptyelem <iframe>} </textarea>}]>
>> Hpricot(html)
=> #<Hpricot::Doc {elem <html> "\n" {elem <textarea> {emptyelem <iframe>} </textarea>} "\n" </html>}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment