loofah 2.21.0 → 2.21.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b8eaa7f3006e69a9879def4bb63d4ffce0c8ed5ee404032379702d25e7b12c1
4
- data.tar.gz: ed432220263d87db39f150c772e63b39ee30a2c133bf0179fa6f31d43a538ca8
3
+ metadata.gz: '00569b28a0bc6307a0a8eb8704ad374f10269008dada5d09470c1a2a87da0a6f'
4
+ data.tar.gz: eff12a44f1152dc377ac0a6859be97f85b5a0a031a0b7688387c73f7130351d3
5
5
  SHA512:
6
- metadata.gz: 0cb076b4d791c0c121058b0b7a8f63032b27fcf75f338e98d3ec2e63ad42db21ee0cce87c6bd7381b3d88e7d41d1912002ce949779fa7037732692521ed881ec
7
- data.tar.gz: f90b086a629919f3e01d8535ed735b3c2d918310638895220218b2a88f43f6a023c8d87466aa70311afdc93323227cc1813729643bf88ad77126ca8d3eb7324d
6
+ metadata.gz: fbcf412c0105203fe3d9ee057dc146cc7f8e9f29587c0f97b9c03a5206eacd31f7170042c74050d40093875b8109f524434a0960ef9305269fdda536e3049e3b
7
+ data.tar.gz: 48c3f2c0f4a0b2316c46ad1826c61ded9c3438ace28c477d7b67cc345847a00bb5747bab5b22cf5d774e82c90bedd085a9878c40609f93abda49f6aa01257f7c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.21.3 / 2023-05-15
4
+
5
+ * Quash "instance variable not initialized" warning in Ruby < 3.0. [[#268](https://github.com/flavorjones/loofah/issues/268)] (Thanks, [@dharamgollapudi](https://github.com/dharamgollapudi)!)
6
+
7
+
8
+ ## 2.21.2 / 2023-05-11
9
+
10
+ ### Dependencies
11
+
12
+ * Update the dependency on Nokogiri to be `>= 1.12.0`. The dependency in 2.21.0 and 2.21.1 was left at `>= 1.5.9` but versions before 1.12 would result in a `NameError` exception. [[#266](https://github.com/flavorjones/loofah/issues/266)]
13
+
14
+
15
+ ## 2.21.1 / 2023-05-10
16
+
17
+ ### Fixed
18
+
19
+ * Don't define `HTML5::Document` and `HTML5::DocumentFragment` when Nokogiri is `< 1.14`. In 2.21.0 these classes were defined whenever `Nokogiri::HTML5` was defined, but Nokogiri v1.12 and v1.13 do not support Loofah subclassing properly.
20
+
21
+
3
22
  ## 2.21.0 / 2023-05-10
4
23
 
5
24
  ### HTML5 Support
data/README.md CHANGED
@@ -290,7 +290,11 @@ These are not required automatically. You must require `loofah/helpers` to use t
290
290
 
291
291
  Unsurprisingly:
292
292
 
293
- * gem install loofah
293
+ > gem install loofah
294
+
295
+ Requirements:
296
+
297
+ * Ruby >= 2.5
294
298
 
295
299
 
296
300
  ## Support
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Loofah
4
4
  # The version of Loofah you are using
5
- VERSION = "2.21.0"
5
+ VERSION = "2.21.3"
6
6
  end
data/lib/loofah.rb CHANGED
@@ -7,14 +7,11 @@ module Loofah
7
7
  def html5_support?
8
8
  # Note that Loofah can only support HTML5 in Nokogiri >= 1.14.0 because it requires the
9
9
  # subclassing fix from https://github.com/sparklemotion/nokogiri/pull/2534
10
- unless @html5_support_set
11
- @html5_support = (
12
- Gem::Version.new(Nokogiri::VERSION) > Gem::Version.new("1.14.0") &&
13
- Nokogiri.uses_gumbo?
14
- )
15
- @html5_support_set = true
16
- end
17
- @html5_support
10
+ return @html5_support if defined? @html5_support
11
+
12
+ @html5_support =
13
+ Gem::Version.new(Nokogiri::VERSION) > Gem::Version.new("1.14.0") &&
14
+ Nokogiri.uses_gumbo?
18
15
  end
19
16
  end
20
17
  end
@@ -36,7 +33,7 @@ require_relative "loofah/xml/document_fragment"
36
33
  require_relative "loofah/html4/document"
37
34
  require_relative "loofah/html4/document_fragment"
38
35
 
39
- if Nokogiri.respond_to?(:uses_gumbo?) && Nokogiri.uses_gumbo?
36
+ if Loofah.html5_support?
40
37
  require_relative "loofah/html5/document"
41
38
  require_relative "loofah/html5/document_fragment"
42
39
  end
@@ -123,19 +120,19 @@ module Loofah
123
120
  end
124
121
  else
125
122
  def html5_document(*args, &block)
126
- raise NotImplementedError, "HTML5 is not supported by your version of Nokogiri"
123
+ raise NotImplementedError, "Loofah::HTML5 is not supported by your version of Nokogiri"
127
124
  end
128
125
 
129
126
  def html5_fragment(*args, &block)
130
- raise NotImplementedError, "HTML5 is not supported by your version of Nokogiri"
127
+ raise NotImplementedError, "Loofah::HTML5 is not supported by your version of Nokogiri"
131
128
  end
132
129
 
133
130
  def scrub_html5_document(string_or_io, method)
134
- raise NotImplementedError, "HTML5 is not supported by your version of Nokogiri"
131
+ raise NotImplementedError, "Loofah::HTML5 is not supported by your version of Nokogiri"
135
132
  end
136
133
 
137
134
  def scrub_html5_fragment(string_or_io, method)
138
- raise NotImplementedError, "HTML5 is not supported by your version of Nokogiri"
135
+ raise NotImplementedError, "Loofah::HTML5 is not supported by your version of Nokogiri"
139
136
  end
140
137
  end
141
138
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loofah
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.21.0
4
+ version: 2.21.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-05-10 00:00:00.000000000 Z
12
+ date: 2023-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: crass
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 1.5.9
34
+ version: 1.12.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: 1.5.9
41
+ version: 1.12.0
42
42
  description: |
43
43
  Loofah is a general library for manipulating and transforming HTML/XML documents and fragments,
44
44
  built on top of Nokogiri.
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
- version: '0'
93
+ version: 2.5.0
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - ">="