-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
Double quotes URL-escaped in attribute when using JRuby #1382
Comments
Hi @flavorjones ! Thanks for the reply! As far as I can see this is not just a cosmetic difference in handling. The resulting document is changed, and is no longer equivalent. In my case it results in a broken web page. If it is all handled by an upstream library, we should file an issue in their tracker. Which project would that be? Any easy way I can test that library without Nokogiri? |
Thanks @donv for reporting this issue. I'll have some time the next few days to take a look at this issue. Hopefully it's an easy fix. |
Thanks @jvshahid ! Much appreciated! |
Hi @jvshahid ! I tried a Xerces example using JRuby 9.0.4.0 without Nokogiri. It seems Xerces is included in JRuby somehow: https://gist.github.com/donv/ed8b296ccfc99f927f71 It does not URL-escape the attribute in any way. Maybe this helps. 😄 |
Hi @jvshahid ! Have you had time to look at this? |
Unfortunately I haven't. I am currently working on |
Hi @flavorjones @jvshahid ! Happy new year! How is the 1.6.8 release coming along? Going well, I hope. Hang in there! |
Hi @flavorjones @jvshahid ! How are you doing? I am just checking in to say that this issue is still a problem. I see 1.6.8 has had some progress. I wish you a happy release! 😄 |
Hi @flavorjones @jvshahid ! Have you had time to look at this issue? My PR succeeds for JRuby, but fails for MRI. That is weird since the manual test in IRB works with all versions of MRI. |
Hi @donv, Apologies for the lack of response. I think we both deprioritized looking at this because we don't totally understand the problem you're trying to solve, nor why you believe this is a problem. The three representations of a quote ( Have you looked at
renders the attribute identically on both JRuby (xerces) and MRI (libxml2):
and
I hope this helps? We historically have not accepted PRs that try to work around these smaller differences in how xerces and libxml2 format their output. Better to let the parser be the parser, in our opinion. There are simply too many differences in output to take care of (e.g., "should an html doc always have a head node?", "how should whitespace be handled?"), and so we've identified EXACTLY equal output as an anti-goal. But again, try |
Thanks. Using #canonicalize seems to solve my problems. |
Hi!
When using JRuby to parse, modify, and output an HTML document with double quotes in an attribute, the double quote is URL-escaped as
%22
. I believe this is wrong behaviour. The double quote should be left alone as it is when using MRI.The text was updated successfully, but these errors were encountered: