2011-05-24 87 views
1

的htmlclean插件什麼是在下面的代碼行這個網站清潔用品什麼是用於

$('body').html($.htmlClean($(this).html(), { allowedTags : ['a', 'ul', 'ol', 'li', 'br', 'p'] })); 

回答

2

一個簡單的谷歌搜索給了我以下頁面: http://code.google.com/p/jquery-clean/

注意到骯髒(X)HTML並生成漂亮乾淨的XHTML(這將刪除並清除從其他來源粘貼的HTML,例如MS Word。) 它會;

fix self closing tags 
lower-case tags 
remove non-standard attributes 
remove in-line style attributes 
remove in-line event attributes 
optionally remove other attributes 
tidy unnecessary white space and new lines 
remove conditional commenting 
remove proprietary word formatting tags 
replace tags e.g. i=>em 
optionally leave css classes in place 
format and indent html