Skip to main content

smart_clean_html

Function smart_clean_html 

Source
pub fn smart_clean_html(html: &str, intent: CleaningIntent) -> String
Expand description

Smart HTML cleaner that automatically determines the best cleaning level.

This is the recommended function for cleaning HTML when you don’t have a specific profile preference. It analyzes the content and chooses the optimal cleaning level based on:

  • Content size and text ratio
  • Presence of heavy elements (SVGs, canvas, video)
  • The intended use case (extraction vs action)