So I'm running an HTML fragment through nokogiri, and I'm getting some
odd behavior. My fragment is a little non-standard, HTML wise, but I'm
confused by what's going on, and wondering if you can help explain
(and surpress) the behavior I'm seeing.
Basically, I've got a fragment, which I'm running through
Nokogiri::HTML.fragment(<fragment>). The fragment contains an a tag,
around a table (ex <a ...><table>...</table></a>). However, when I run
the fragment through nokogiri and to_s it, it rewrite the a tag so it
no longer surrounds the table (ex <a...></a><table>...</table>).
1) Why is it doing this?
2) How can I stop this behavior?
Any insight would be appreciated!