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

Sanitize broken in JRuby #54

Closed
aselder opened this issue Jun 4, 2012 · 6 comments
Closed

Sanitize broken in JRuby #54

aselder opened this issue Jun 4, 2012 · 6 comments
Labels

Comments

@aselder
Copy link

aselder commented Jun 4, 2012

Case #1 - MRI (1.9.2-p290, 1.9.3-p194)

Nokogiri::VERSION   # => "1.5.0"
Sanitize.clean("a<a> b </a>") # => "a b " 

Case #2 (JRuby-1.6.7.2)

Nokogiri::VERSION   # => "1.5.3"
Sanitize.clean("a<a> b </a>") # => "a" 
@aselder
Copy link
Author

aselder commented Jun 4, 2012

A little more info. Adding a "puts node" before line 151 of santize.rb

MRI

a
 b 
<a></a>
a b 

JRuby

a
 b 
<a> b </a>
a

@rgrove
Copy link
Owner

rgrove commented Jun 4, 2012

The JRuby version of Nokogiri behaves very differently from the MRI version. There's not much Sanitize can do about this short of switching to a custom HTML parser. For this reason, I don't consider JRuby an officially supported platform. Sorry.

@rgrove rgrove closed this as completed Jun 4, 2012
@aselder
Copy link
Author

aselder commented Jun 4, 2012

Looking like an inconsistency in Nokogiri between JRuby and MRI

@aselder
Copy link
Author

aselder commented Jun 4, 2012

FYI, I tracked down this to an issue in Nokogiri: https://github.com/tenderlove/nokogiri/issues/691

@LeifWarner
Copy link

Sanitize.clean("a<a> b </a>") seems to work for me on JRuby.

@aselder
Copy link
Author

aselder commented May 11, 2013

Yes, the underlying nokogiri bug was fixed in 1.5.5

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

No branches or pull requests

3 participants