File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ fn convert_node_recursive(
107107 _metrics,
108108 ) ?;
109109 }
110- } else {
110+ } else if matches ! ( kuchiki_node . data ( ) , KuchikiNodeData :: Document ( _ ) ) {
111111 // For document nodes, just process children directly
112112 for child in kuchiki_node. children ( ) {
113113 convert_node_recursive (
@@ -120,6 +120,9 @@ fn convert_node_recursive(
120120 _metrics,
121121 ) ?;
122122 }
123+ } else {
124+ // Blocked element: drop entire subtree to avoid leaking script/style contents
125+ tracing:: debug!( "🚫 Dropping blocked node and its children" ) ;
123126 }
124127
125128 Ok ( ( ) )
@@ -386,4 +389,4 @@ mod tests {
386389 }
387390 }
388391 }
389- }
392+ }
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ mod tests {
105105
106106 // Verify that security analysis was performed
107107 if let Some ( analysis) = & result. security_analysis {
108- assert ! ( analysis. threat_level != css_security:: ThreatLevel :: Safe , "Should detect threats" ) ;
108+ assert ! ( analysis. threat_level != css_security:: CssThreatLevel :: Safe , "Should detect threats" ) ;
109109 assert ! ( analysis. violations_count > 0 , "Should detect violations" ) ;
110110 }
111111
You can’t perform that action at this time.
0 commit comments