Skip to content
New issue

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

Space lost between sub and sup tags #578

Closed
rbreu opened this issue Dec 2, 2011 · 1 comment
Closed

Space lost between sub and sup tags #578

rbreu opened this issue Dec 2, 2011 · 1 comment

Comments

@rbreu
Copy link

rbreu commented Dec 2, 2011

(Using Nokogiri 1.5.0)

For almost all inline tags, Nokogiri preserves space between subsequent tags, as I'd expect it to:

irb(main):004:0> Nokogiri::HTML.fragment("<em>a</em> <em>b</em>").to_s
=> "<em>a</em> <em>b</em>"

However, between sup and sub tags, the space gets lost:

irb(main):002:0> Nokogiri::HTML.fragment("<sup>a</sup> <sup>b</sup>").to_s
=> "<sup>a</sup><sup>b</sup>"

irb(main):003:0> Nokogiri::HTML.fragment("<sub>a</sub> <sub>b</sub>").to_s
=> "<sub>a</sub><sub>b</sub>"

Since it makes a difference when displayed in the browser whether the space is there or not, this looks like a bug to me?

@flavorjones
Copy link
Member

Hello!

Thanks for asking this question!

Unfortunately, this behavior is dependent on the underlying libraries -- there's not much we can do in Nokogiri to change serialization conventions. :(

Sorry we can't do much for your problem, but thanks for using Nokogiri.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants