selma 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cargo.lock +2 -2
- data/ext/selma/Cargo.toml +1 -1
- data/ext/selma/src/rewriter.rs +13 -11
- data/lib/selma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9470897ee5c29d09763cfbbe3fb70486b0efc76594abdbeae188a4b6d1db3917
|
4
|
+
data.tar.gz: 7df5c4a23af18df2cb483165a0e6631447da9ca5ea7f0c76270c2830e15bf8d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7639b57eccda8352ff85a502aa56e3e3c0e7bfeb0381648562aae290f65f4a31a4e794797e3dc522ed3e445449463e922b79fcc89f71e769dc5f7e53933f7b8
|
7
|
+
data.tar.gz: 7db5811dbf01678d5033ac045001702c3195eba10d23183598f60bf40686f8be6e28f5e76517f7da3984972d6b530ee3e9d498f4f8a3f0f111d06806dde34c61
|
data/Cargo.lock
CHANGED
@@ -284,9 +284,9 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
|
284
284
|
|
285
285
|
[[package]]
|
286
286
|
name = "lol_html"
|
287
|
-
version = "
|
287
|
+
version = "2.0.0"
|
288
288
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
289
|
-
checksum = "
|
289
|
+
checksum = "964b47c14635e111f7efddcd8f1f8794195f66225fef19822fa942b217a859cf"
|
290
290
|
dependencies = [
|
291
291
|
"bitflags 2.6.0",
|
292
292
|
"cfg-if",
|
data/ext/selma/Cargo.toml
CHANGED
data/ext/selma/src/rewriter.rs
CHANGED
@@ -350,11 +350,11 @@ impl SelmaRewriter {
|
|
350
350
|
}
|
351
351
|
}
|
352
352
|
|
353
|
-
pub fn perform_handler_rewrite(
|
353
|
+
pub fn perform_handler_rewrite<'a>(
|
354
354
|
&self,
|
355
|
-
sanitizer_document_content_handlers: Vec<DocumentContentHandlers
|
356
|
-
sanitizer_element_content_handlers: Vec<(Cow<Selector>, ElementContentHandlers)>,
|
357
|
-
handlers: &[Handler],
|
355
|
+
sanitizer_document_content_handlers: Vec<DocumentContentHandlers<'a>>,
|
356
|
+
sanitizer_element_content_handlers: Vec<(Cow<Selector>, ElementContentHandlers<'a>)>,
|
357
|
+
handlers: &'a [Handler],
|
358
358
|
html: String,
|
359
359
|
) -> Result<Vec<u8>, magnus::Error> {
|
360
360
|
// TODO: this should ideally be done ahead of time on `initialize`, not on every `#rewrite` call
|
@@ -431,10 +431,12 @@ impl SelmaRewriter {
|
|
431
431
|
let closure_element_stack = element_stack.clone();
|
432
432
|
|
433
433
|
if let Some(end_tag_handlers) = el.end_tag_handlers() {
|
434
|
-
end_tag_handlers.push(Box::new(
|
435
|
-
|
436
|
-
|
437
|
-
|
434
|
+
end_tag_handlers.push(lol_html::EndTagHandler::into(Box::new(
|
435
|
+
move |_end_tag| {
|
436
|
+
closure_element_stack.as_ref().borrow_mut().pop();
|
437
|
+
Ok(())
|
438
|
+
},
|
439
|
+
)));
|
438
440
|
}
|
439
441
|
|
440
442
|
Ok(())
|
@@ -449,10 +451,10 @@ impl SelmaRewriter {
|
|
449
451
|
)
|
450
452
|
}
|
451
453
|
|
452
|
-
fn run_rewrite(
|
454
|
+
fn run_rewrite<'a>(
|
453
455
|
&self,
|
454
|
-
document_content_handlers: Vec<DocumentContentHandlers
|
455
|
-
element_content_handlers: Vec<(Cow<Selector>, ElementContentHandlers)>,
|
456
|
+
document_content_handlers: Vec<DocumentContentHandlers<'a>>,
|
457
|
+
element_content_handlers: Vec<(Cow<Selector>, ElementContentHandlers<'a>)>,
|
456
458
|
html: &[u8],
|
457
459
|
) -> Result<Vec<u8>, magnus::Error> {
|
458
460
|
let binding = &self.0.borrow();
|
data/lib/selma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen J. Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb_sys
|