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

fix: HTML5::Document#url returns the URL passed to the parser #2584

Merged
merged 2 commits into from
Jun 23, 2022

Conversation

flavorjones
Copy link
Member

@flavorjones flavorjones commented Jun 23, 2022

What problem is this PR intended to solve?

Closes #2583

HTML5::Document#url now matches the behavior of HTML4::Document and XML::Document. Previously this method always returned nil.

I've also improved the documentation for HTML5::Document.

Have you included adequate test coverage?

Yes!

Does this change affect the behavior of either the C or the Java implementations?

This affects the behavior of HTML5::Document which only exists in the C implementation today.

This matches the behavior of HTML4::Document and
XML::Document. Previously this method always returned `nil`.

Fixes #2583
Copy link

@jgarber623 jgarber623 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with the same script outlined in #2583 (but with the gem source pointing at this PR's branch) and everything works as expected!

$ ruby test.rb
Testing Nokogiri::HTML...
https://hello.example
Testing Nokogiri::HTML4...
https://hello.example
Testing Nokogiri::HTML5...
https://hello.example

Thanks for the quick fix! 🎉

@flavorjones flavorjones merged commit 4144e6c into main Jun 23, 2022
@flavorjones flavorjones deleted the 2583-html5-document-url branch June 23, 2022 16:23
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

Successfully merging this pull request may close these issues.

[bug] HTML5 parser loses reference to url parameter value
2 participants