Skip to content

Commit

Permalink
Update nokogiri-html5-inference to latest PR branch
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed May 2, 2024
1 parent b49b864 commit b62269d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ source "https://rubygems.org"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gemspec

gem "nokogiri-html5-inference", github: "flavorjones/nokogiri-html5-inference", branch: "flavorjones-always-return-nodeset"
11 changes: 9 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/flavorjones/nokogiri-html5-inference
revision: 7426a3601d30bf6cb9794d6b5c2e767151a0fa6f
branch: flavorjones-always-return-nodeset
specs:
nokogiri-html5-inference (0.2.0)
nokogiri (~> 1.14)

PATH
remote: .
specs:
Expand Down Expand Up @@ -128,8 +136,6 @@ GEM
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
nokogiri-html5-inference (0.2.0)
nokogiri (~> 1.14)
parallel (1.22.1)
parser (3.2.1.0)
ast (~> 2.4.1)
Expand Down Expand Up @@ -214,6 +220,7 @@ DEPENDENCIES
bundler (~> 2.0)
magic_frozen_string_literal (~> 1.2)
mocha (~> 1.13)
nokogiri-html5-inference!
rails (>= 5.2, < 8)
rake (~> 13.0)
standard (~> 1.24)
Expand Down
24 changes: 12 additions & 12 deletions test/html/document_fragment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase

assert_equal "Some String", fragment.to_html
assert_equal "Some String", fragment.outer_html
assert_equal "Some String", fragment.inner_html
assert_equal "", fragment.inner_html

assert_nil fragment.match("html").to_html
assert_nil fragment.match("html").outer_html
Expand All @@ -56,7 +56,7 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase

assert_equal "123", fragment.to_html
assert_equal "123", fragment.outer_html
assert_equal "123", fragment.inner_html
assert_equal "", fragment.inner_html

assert_nil fragment.match("html").to_html
assert_nil fragment.match("html").outer_html
Expand Down Expand Up @@ -345,8 +345,8 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase
)
fragment = StimulusReflex::HTML::DocumentFragment.new(html)

assert_equal %(<head></head><body> </body>), fragment.to_html.squish
assert_equal %(<head></head><body> </body>), fragment.outer_html.squish
assert_equal %(<head></head> <body> </body>), fragment.to_html.squish
assert_equal %(<head></head> <body> </body>), fragment.outer_html.squish
end

test "<head> alongside <body> with content" do
Expand All @@ -361,8 +361,8 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase
)
fragment = StimulusReflex::HTML::DocumentFragment.new(html)

assert_equal %(<head> <meta name="attribute" content="value"> </head><body class="bg-green-200"> <h1>Hello World</h1> </body>), fragment.to_html.squish
assert_equal %(<head> <meta name="attribute" content="value"> </head><body class="bg-green-200"> <h1>Hello World</h1> </body>), fragment.outer_html.squish
assert_equal %(<head> <meta name="attribute" content="value"> </head> <body class="bg-green-200"> <h1>Hello World</h1> </body>), fragment.to_html.squish
assert_equal %(<head> <meta name="attribute" content="value"> </head> <body class="bg-green-200"> <h1>Hello World</h1> </body>), fragment.outer_html.squish
end

test "<head> alongside <body> inside <html>" do
Expand Down Expand Up @@ -432,8 +432,8 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase
)
fragment = StimulusReflex::HTML::DocumentFragment.new(html)

assert_equal %(<head> <title>Title</title> </head><body></body>), fragment.to_html.squish
assert_equal %(<head> <title>Title</title> </head><body></body>), fragment.outer_html.squish
assert_equal %(<head> <title>Title</title> </head> <body></body>), fragment.to_html.squish
assert_equal %(<head> <title>Title</title> </head> <body></body>), fragment.outer_html.squish
end

test "non-closed <meta>" do
Expand Down Expand Up @@ -464,8 +464,8 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase
)
fragment = StimulusReflex::HTML::DocumentFragment.new(html)

assert_equal %(<head> <meta name="title" content="value"> </head><body></body>), fragment.to_html.squish
assert_equal %(<head> <meta name="title" content="value"> </head><body></body>), fragment.outer_html.squish
assert_equal %(<head> <meta name="title" content="value"> </head> <body></body>), fragment.to_html.squish
assert_equal %(<head> <meta name="title" content="value"> </head> <body></body>), fragment.outer_html.squish
end

test "closed <meta> in <head>" do
Expand All @@ -476,8 +476,8 @@ class StimulusReflex::HTML::DocumentFragmentTest < ActiveSupport::TestCase
)
fragment = StimulusReflex::HTML::DocumentFragment.new(html)

assert_equal %(<head> <meta name="title" content="value"> </head><body></body>), fragment.to_html.squish
assert_equal %(<head> <meta name="title" content="value"> </head><body></body>), fragment.outer_html.squish
assert_equal %(<head> <meta name="title" content="value"> </head> <body></body>), fragment.to_html.squish
assert_equal %(<head> <meta name="title" content="value"> </head> <body></body>), fragment.outer_html.squish
end

test "uppercase tags" do
Expand Down

0 comments on commit b62269d

Please sign in to comment.