private static void cleanStyles ( Element e ) { if ( e == null ) { return ; } Element cur = e . children ( ) . first ( ) ; // Remove any root styles, if we're able. if ( ! "readability-styled" . equals ( e . className ( ) ) ) { e . removeAttr ( "style" ) ; } // Go until there are no more child nodes while ( cur != null ) { // Remove style attributes if ( ! "readability-styled" . equals ( cur . className ( ) ) ) { cur . removeAttr ( "style" ) ; } cleanStyles ( cur ) ; cur = cur . nextElementSibling ( ) ; } }
Remove the style attribute on every e and under .