大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 网页设计 -> 网页特效 -> 清除WORD冗余格式并粘贴

清除WORD冗余格式并粘贴

时间: 2021-07-31 作者:daque

/ 清除WORD冗余格式并粘贴function cleanandpaste( html ) { // remove all span tags html = html.replace(/<\/?span[^>]*>/gi, "" ); // remove class attributes html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ; // remove style attributes html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ; // remove lang attributes html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ; // remove xml elements and declarations html = html.replace(/<\\?\?xml[^>]*>/gi, "") ; // remove tags with xml namespace declarations: <o:p></o:p> html = html.replace(/<\/?\w+:[^>]*>/gi, "") ; // replace the   html = html.replace(/ /, " " ); // transform <p> to <div> var re = new regexp("(<p)([^>]*>.*?)(<\/p>)","gi") ; // different because of a ie 5.0 error html = html.replace( re, "<div$2</div>" ) ;  inserthtml( html ) ;}

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.