selma 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/selma/src/rewriter.rs +6 -16
- 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: 4f3bbf7895a04619bbf8f4c4a703b4d84d9621eef2e492dbca69ddec287b51bf
|
4
|
+
data.tar.gz: 78f4a3afa4b340f1261c8d4ed99089ff916dba2d4c1dbde250b1be111d69e6c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825e71b47e7cc393ed592a62bca3c2d9147ca0c6ecb234cde9c7a6593e63eb10692811b3ea8460a2426878a6fc4f70646187e80bdf9f5fc4331ae2187da2a032
|
7
|
+
data.tar.gz: 02c81c3b84a49ac65a93dcc3c16d3950ad20034820e8f551d42149938bbb85e20793e7156576026c54e2fec7571382403f6b23e6910a32f0b9a3327c3e4615cf
|
data/ext/selma/src/rewriter.rs
CHANGED
@@ -304,7 +304,7 @@ impl SelmaRewriter {
|
|
304
304
|
}
|
305
305
|
};
|
306
306
|
|
307
|
-
let handlers = &binding.handlers;
|
307
|
+
let handlers: &Vec<Handler> = &binding.handlers;
|
308
308
|
|
309
309
|
match Self::perform_handler_rewrite(
|
310
310
|
self,
|
@@ -372,6 +372,9 @@ impl SelmaRewriter {
|
|
372
372
|
// TODO: this should ideally be done ahead of time on `initialize`, not on every `#rewrite` call
|
373
373
|
let mut element_content_handlers: Vec<(Cow<Selector>, ElementContentHandlers)> = vec![];
|
374
374
|
|
375
|
+
// have sanitization happen first
|
376
|
+
element_content_handlers.extend(sanitizer_element_content_handlers);
|
377
|
+
|
375
378
|
handlers.iter().for_each(|handler| {
|
376
379
|
let element_stack: Rc<RefCell<Vec<String>>> = Rc::new(RefCell::new(vec![]));
|
377
380
|
|
@@ -451,25 +454,12 @@ impl SelmaRewriter {
|
|
451
454
|
}));
|
452
455
|
});
|
453
456
|
|
454
|
-
|
457
|
+
Self::run_rewrite(
|
455
458
|
self,
|
456
459
|
sanitizer_document_content_handlers,
|
457
460
|
element_content_handlers,
|
458
461
|
html.as_bytes(),
|
459
|
-
)
|
460
|
-
|
461
|
-
// sanitization must happen separately, because text chunks
|
462
|
-
// could potentially have rewritten the html. ideally we'd
|
463
|
-
// be able to sanitize around the `process_text_handlers` call
|
464
|
-
match rewritten_html {
|
465
|
-
Ok(rewritten_html) => Self::run_rewrite(
|
466
|
-
self,
|
467
|
-
vec![],
|
468
|
-
sanitizer_element_content_handlers,
|
469
|
-
rewritten_html.as_slice(),
|
470
|
-
),
|
471
|
-
Err(err) => Err(err),
|
472
|
-
}
|
462
|
+
)
|
473
463
|
}
|
474
464
|
|
475
465
|
fn run_rewrite(
|
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.2
|
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-07-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb_sys
|