Sat, 27 September 2008

This is a small add-in for jQuery which will take dirty old html, say from ms Word, and give it a proper scrubbing.

The first release of this code will;

  • fix self closing tags
  • lower-case tags
  • remove non-standard attributes
  • remove class attributes
  • remove in-line style attributes
  • remove in-line event attributes
  • tidy unnecessary white space and new lines
  • remove conditional commenting
  • remove proprietary word formatting tags

It does not give you a formatted result, it removes unnecessary white space and new line characters.

It also only returns the body of a html page. This will be a default option in the full version.

This is an open source project to be found at
http://code.google.com/p/jquery-clean/

The plug-in page on jQuery can be found here
http://plugins.jquery.com/project/htmlClean/

Try it out here

/Content/Demos/jQuery-htmlClean/Test.htm


HTML, Development

Comments

3 Jun 2010

scozzard

love this plugin. One thing - you link to the demo needs updating :)


4 Jun 2010

Ant

oops - done - ta


Please feel free to add your comments here


(required)


(required, not shown)

(required)