We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using HTML, no extra whitespace (indentation) is added. For example:
Nokogiri::XML('<pre><code>moo</code></pre>').to_html # => "<pre><code>moo</code></pre>\n"
However, with XHTML (and XML), the original line is split in three lines (pre, code, and /pre) and the middle line is erroneously indented, like this:
Nokogiri::XML('<pre><code>moo</code></pre>').to_xhtml # => "<pre>\n <code>moo</code>\n</pre>\n"
The text was updated successfully, but these errors were encountered:
Hello,
I've faced a similar issue with sanitize first, but the author forwarded this to nokogiri:
sanitize
nokogiri
>> Nokogiri::HTML.fragment('<b><a href="http://foo.com/">foo</a></b><img src="http://foo.com/bar.jpg" />').to_xhtml => "<b>\n <a href=\"http://foo.com/\">foo</a>\n</b><img src=\"http://foo.com/bar.jpg\" />"
Here's the original issue discussion: rgrove/sanitize#47 (comment)
It happens on nokogiri 1.5.0 and ree 1.8.7 (probably ruby 1.8.7 as well)
nokogiri 1.5.0
ree 1.8.7
ruby 1.8.7
Sorry, something went wrong.
For XML, you can turn off formatting by calling #to_xml as follows:
#to_xml
doc.to_xml(:save_with => 0)
There's some strangeness in the serializers. It's worth a discussion on the core team. We'll probably revamp this for the next major release.
No branches or pull requests
When using HTML, no extra whitespace (indentation) is added. For example:
However, with XHTML (and XML), the original line is split in three lines (pre, code, and /pre) and the middle line is erroneously indented, like this:
The text was updated successfully, but these errors were encountered: