|
Project Information
Members
Featured
Downloads
|
Takes dirty dirty (X)HTML and produces nice clean XHTML It will;
Options
Example$.htmlClean("<H1 class=\"header\"><P>Nested P Test</H1>", {format:true});
=>
<h1>
Nested P Test
</h1>Demo http://www.antix.co.uk/Content/Demos/jQuery-htmlClean/Test.htm jQuery Plug-in page http://plugins.jquery.com/project/htmlClean 1.2.2replaceStyles added for replacement of bold, italic, super and sub styles on an element this is to add more robust style/tag replacement Multiple style matches supported, inline elements are replaced by the first match, block-level elements are retained 1.2.0Black and white lists added, see allowedTags and removeTags above Thanks to thanks to David Wartian (Dwartian) for suggestion and code 1.1.0Now you can specify css classes that you want to retain Also, it formats and indents the cleaned html, default is false 1.0.1Trim start fix Whitespace on inline elements fixed 1.0.0Bug fixes for greedy attribute selection and order of attribute removal Trim functions:
nb These functions do not use regex to trim and are therefore safe to use in a regex.exec loop 0.9.3Now cleans web kit span style tags <span class="Apple-style-span" style="font-weight: bold;"> => <strong> jQuery function added $("#SomeElement").htmlClean() |