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
Support ruby 3 #23
Support ruby 3 #23
Conversation
ref: - uri encoding: https://docs.knapsackpro.com/2020/uri-escape-is-obsolete-percent-encoding-your-query-string - agument splat: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ - bundle webrick: https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/
Hey @marocchino, thanks for the update I've started the ci on gitlab (having issues with travis) and some tests are failing i will try to have a look before merging cf https://gitlab.com/spkdev/validate-website/-/jobs/947968716 |
On the history I've got something strange
You can print |
``` irb(main):001:0> require 'webrick' => true irb(main):002:0> URI.parse(URI.encode_www_form_component("http://example.com/path?query=あああ")) => #<URI::Generic http%3A%2F%2Fexample.com%2Fpath%3Fquery%3D%E3%81%82%E3%81%82%E3%81%82> irb(main):003:0> URI.parse(WEBrick::HTTPUtils.escape("http://example.com/path?query=あああ")) => #<URI::HTTP http://example.com/path?query=%E3%81%82%E3%81%82%E3%81%82> ```
@@ -46,7 +46,7 @@ def extract_imgs_from_page(page) | |||
|
|||
page.doc.search('//img[@src]').reduce(Set[]) do |result, elem| | |||
u = elem.attributes['src'].content | |||
result << page.to_absolute(URI.parse(URI.encode(u))) | |||
result << page.to_absolute(URI.parse(WEBrick::HTTPUtils.escape(u))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
irb(main):001:0> require 'webrick'
=> true
irb(main):002:0> URI.parse(URI.encode_www_form_component("http://example.com/path?query=あああ"))
=> #<URI::Generic http%3A%2F%2Fexample.com%2Fpath%3Fquery%3D%E3%81%82%E3%81%82%E3%81%82>
irb(main):003:0> URI.parse(WEBrick::HTTPUtils.escape("http://example.com/path?query=あああ"))
=> #<URI::HTTP http://example.com/path?query=%E3%81%82%E3%81%82%E3%81%82>
As a result of running it locally, html5 related errors occur. There is no control group because the same result is given in the master branch(and ruby 2.7.2), but is it a problem with the tidy engine?
|
Yes you need the tidy-dev, headers packages for this to pass but this look good thanks again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Thank you! |
ref: