selma 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 968ea670eb08eb49bbb5c305e257f87e4c38bd8371c9f0ba823600cc2be6c660
4
- data.tar.gz: 83a5af8a2314d041ac6ae153db21271d57665c7b6a3ad851bdcb92c7753610d0
3
+ metadata.gz: 9bad668396052252afb3ff8e14400bbe010624aa224ef4c186d52f31939c7ccc
4
+ data.tar.gz: 5df036f8760268c7377fd447d30196f551a8ce4c55d93a38a9318e5a40dfd86c
5
5
  SHA512:
6
- metadata.gz: 2673b5d305855725ffa53b343cdb6fa8da91903a914da50211eeff4acc17eee54837c29e6e8d19d20ad52c29075dc8ea2b2c9700b6cf0dfd255665aa0adfaccf
7
- data.tar.gz: edd5982cef291e0fc666117c0ba0f6e7b18de03a007dc55b6a464b3fe0cb67db51435d86050ea01743694c65a8bd373debb606eff58a79a1e4fe361efa57912f
6
+ metadata.gz: bbb137a5b8013274687d6122c791ec2c30efbe13f5a5b2688ea60888ecf010b0ff7f4a17eb1ab3f2691ff7527240e0428ad45d616f159cf86be7c1f41bb1cbc6
7
+ data.tar.gz: c80e09b3e9de266be755cdda31e3c03c91b2fd2c40b0175a741e8b70ea965e9a8f43be929a0de802254af6656b5a7c7420bbb3b17556fc4dd3a7fa34f0e28b6f
data/Cargo.lock CHANGED
@@ -275,9 +275,9 @@ dependencies = [
275
275
 
276
276
  [[package]]
277
277
  name = "magnus"
278
- version = "0.8.2"
278
+ version = "0.9.0"
279
279
  source = "registry+https://github.com/rust-lang/crates.io-index"
280
- checksum = "3b36a5b126bbe97eb0d02d07acfeb327036c6319fd816139a49824a83b7f9012"
280
+ checksum = "379d50b6eea4ca84074ccd3e551eb9b07f7865194d5b3198325317e9ef78e5e9"
281
281
  dependencies = [
282
282
  "magnus-macros",
283
283
  "rb-sys",
@@ -287,9 +287,9 @@ dependencies = [
287
287
 
288
288
  [[package]]
289
289
  name = "magnus-macros"
290
- version = "0.8.0"
290
+ version = "0.9.1"
291
291
  source = "registry+https://github.com/rust-lang/crates.io-index"
292
- checksum = "47607461fd8e1513cb4f2076c197d8092d921a1ea75bd08af97398f593751892"
292
+ checksum = "9dafde2eeb66f090e0f326112323eb8324b12cb32b5d1210e541d3df6b0ce77e"
293
293
  dependencies = [
294
294
  "proc-macro2",
295
295
  "quote",
@@ -298,9 +298,9 @@ dependencies = [
298
298
 
299
299
  [[package]]
300
300
  name = "memchr"
301
- version = "2.8.0"
301
+ version = "2.8.3"
302
302
  source = "registry+https://github.com/rust-lang/crates.io-index"
303
- checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
303
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
304
304
 
305
305
  [[package]]
306
306
  name = "mime"
data/README.md CHANGED
@@ -207,7 +207,7 @@ Whenever a sanitizer is in use, a literal `<` in text is emitted as `&lt;`. That
207
207
 
208
208
  ## Benchmarks
209
209
 
210
- When `bundle exec rake benchmark`, two different benchmarks are calculated. Here are those results on my machine.
210
+ The benchmark gems live in an optional Bundler group, so install them first with `bundle config set --local with benchmark && bundle install`. When `bundle exec rake benchmark`, two different benchmarks are calculated. Here are those results on my machine.
211
211
 
212
212
  ### Benchmarks for just the sanitization process
213
213
 
data/ext/selma/Cargo.toml CHANGED
@@ -8,7 +8,7 @@ publish = false
8
8
  [dependencies]
9
9
  enum-iterator = "2.3"
10
10
  escapist = "0.0.2"
11
- magnus = { version = "0.8", features = ["rb-sys"] }
11
+ magnus = { version = "0.9", features = ["rb-sys"] }
12
12
  rb-sys = { version = "*", default-features = false, features = [
13
13
  "stable-api-compiled-fallback",
14
14
  ] }
@@ -171,12 +171,23 @@ impl Tag {
171
171
  pub const TAG_COUNT: usize = 151;
172
172
 
173
173
  /// Identifies whether this is an HTML tag whose contents
174
- /// are considered "text nodes", and thus, must be removed
174
+ /// are considered "text nodes", and thus, must be removed.
175
+ ///
176
+ /// Raw-text elements (`<noscript>`, `<xmp>`, ...) belong here: their content is
177
+ /// tokenized as text, so markup inside it never reaches the sanitizer. Keeping that
178
+ /// content after removing the wrapper would re-emit it verbatim into a context where
179
+ /// the browser parses it as live markup.
175
180
  pub fn has_text_content(tag: Tag) -> bool {
176
181
  tag.index == HTMLTag::SCRIPT as usize
177
182
  || tag.index == HTMLTag::STYLE as usize
178
183
  || tag.index == HTMLTag::MATH as usize
179
184
  || tag.index == HTMLTag::SVG as usize
185
+ || tag.index == HTMLTag::IFRAME as usize
186
+ || tag.index == HTMLTag::NOEMBED as usize
187
+ || tag.index == HTMLTag::NOFRAMES as usize
188
+ || tag.index == HTMLTag::NOSCRIPT as usize
189
+ || tag.index == HTMLTag::PLAINTEXT as usize
190
+ || tag.index == HTMLTag::XMP as usize
180
191
  }
181
192
 
182
193
  /// Is this tag an `<iframe>`?
data/lib/selma/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Selma
4
- VERSION = "0.5.3"
4
+ VERSION = "0.5.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian