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

Update to Nokogiri v1.12 #211

Merged
merged 1 commit into from Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/sanitize.rb
@@ -1,6 +1,6 @@
# encoding: utf-8

require 'nokogumbo'
require 'nokogiri'
require 'set'

require_relative 'sanitize/version'
Expand Down
3 changes: 1 addition & 2 deletions sanitize.gemspec
Expand Up @@ -18,8 +18,7 @@ Gem::Specification.new do |s|

# Runtime dependencies.
s.add_dependency('crass', '~> 1.0.2')
s.add_dependency('nokogiri', '>= 1.8.0')
s.add_dependency('nokogumbo', '~> 2.0')
s.add_dependency('nokogiri', '>= 1.12.0')

# Development dependencies.
s.add_development_dependency('minitest', '~> 5.11.3')
Expand Down
8 changes: 4 additions & 4 deletions test/test_sanitize.rb
Expand Up @@ -53,9 +53,9 @@
@s.document("a#{sample_non_chars}z").must_equal "<html>az</html>"
end

describe 'when html body exceeds Nokogumbo::DEFAULT_MAX_TREE_DEPTH' do
describe 'when html body exceeds Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH' do
let(:content) do
content = nest_html_content('<b>foo</b>', Nokogumbo::DEFAULT_MAX_TREE_DEPTH)
content = nest_html_content('<b>foo</b>', Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH)
"<html>#{content}</html>"
end

Expand Down Expand Up @@ -115,9 +115,9 @@
@s.fragment("a#{sample_non_chars}z").must_equal "az"
end

describe 'when html body exceeds Nokogumbo::DEFAULT_MAX_TREE_DEPTH' do
describe 'when html body exceeds Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH' do
let(:content) do
content = nest_html_content('<b>foo</b>', Nokogumbo::DEFAULT_MAX_TREE_DEPTH)
content = nest_html_content('<b>foo</b>', Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH)
"<body>#{content}</body>"
end

Expand Down