search for: html_unescape

Displaying 3 results from an estimated 3 matches for "html_unescape".

Did you mean: html_escape
2006 Nov 22
1
to_absolute_uri typo in 0.6.3?
...=|b=|c= (etc.) Interestingly, Mechanize 0.6.2 handled this OK, but in 0.6.3 this causes a URI::InvalidURIError exception from URI.parse() in to_absolute_uri in mechanize.rb. I noticed that the new 0.6.3 version of to_absolute_uri starts with: url = URI.parse( URI.unescape(Util.html_unescape(url.to_s.strip)).gsub(/ /, ''%20'') ) unless url.is_a? URI where the old 0.6.2 version started with: url = URI.parse( URI.escape( URI.unescape(url.to_s.strip) )) unless url.is_a? URI It seemed funny to me th...
2007 Jan 12
0
why dose to_absolute_uri use URI.escape?
...y-1.8/lib/ruby/gems/1.8/gems/mechanize-0.6.4/lib/mechanize.rb:272:in `to_absolute_uri'' from C:/opt/ruby-1.8/lib/ruby/gems/1.8/gems/mechanize-0.6.4/lib/mechanize.rb:141:in `get'' from sample.rb:6 to_absolute_uri in mechanize.rb url = URI.parse( URI.unescape(Util.html_unescape(url.to_s.strip)).gsub(/ /, ''%20'') ) unless url.is_a? URI This code cann''t run with escaped multibyte character. Why URI.unescape( "uri" ).gsub(/ /, ''%20'') ? I guess URI.unescape( "uri" ).gsub(/ /, ''%20&...
2006 Dec 30
0
Change I needed to make in to_absolute_uri for unescaped URL separator characters
...Ls with commas. The code in to_absolute_uri works great for spaces, but some pages I was working on had URLs with unescaped commas that URI rejected when I tried to click() on them. So I changed the first statement in Mechanize#to_absolute_uri to: url = URI.parse( URI.unescape( Util.html_unescape(url.to_s.strip)).gsub(/[ ,]/){|m| ''%%%X'' % m[0]} ) unless url.is_a? URI I don''t know what a more complete solution for this bug is, but this at least lets me follow the URLs I need to, so here it is if anyone else needs to use it....