File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to the ` dom_smoothie ` crate will be documented in this file.
4
4
5
+ ## [ Unreleased]
6
+
7
+ ### Changed
8
+ - Updated the internal function ` fix_lazy_images ` to improve how it checks whether an element's class attribute contains the word ` lazy ` .
9
+
5
10
## [ 0.9.0] - 2025-03-17
6
11
7
12
### Added
Original file line number Diff line number Diff line change @@ -237,3 +237,5 @@ pub(crate) static MINI_PRESENTATION: Lazy<MiniSelector> =
237
237
Lazy :: new ( || MiniSelector :: new ( r#"[role="presentation"]"# ) . unwrap ( ) ) ;
238
238
pub ( crate ) static MINI_AINT_DATA_TABLE : Lazy < MiniSelector > =
239
239
Lazy :: new ( || MiniSelector :: new ( r#"[datatable="0"]"# ) . unwrap ( ) ) ;
240
+ pub ( crate ) static MINI_LAZY : Lazy < MiniSelector > =
241
+ Lazy :: new ( || MiniSelector :: new ( r#"[class*="lazy"]"# ) . unwrap ( ) ) ;
Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ fn fix_lazy_images(sel: &Selection) {
309
309
}
310
310
}
311
311
312
- if ( node. has_attr ( "src" ) || node. has_attr ( "srcset" ) ) && !node . has_class ( "lazy" ) {
312
+ if ( node. has_attr ( "src" ) || node. has_attr ( "srcset" ) ) && !MINI_LAZY . match_node ( node ) {
313
313
continue ;
314
314
}
315
315
You can’t perform that action at this time.
0 commit comments