首页 新闻 会员 周边

求js去除word批注的脚本

0
悬赏园豆:15 [已关闭问题] 关闭于 2013-03-07 21:26

如题:求js去除word批注的脚本,谢谢了。

Ben Chan的主页 Ben Chan | 初学一级 | 园豆:3
提问于:2012-12-13 17:26
< >
分享
所有回答(3)
0

JS操作word,客户端的word,有这么大的权限啊?

chenping2008 | 园豆:9836 (大侠五级) | 2012-12-13 17:37
0

你是要找在word 中运行的宏吗?

gunsmoke | 园豆:3592 (老鸟四级) | 2012-12-14 04:55
0

之前开发过编辑器,遇到过这个问题,需要清楚word复制过来的附加内容,代码如下:

function cleanWord(html){

    html = html.replace(/<!--\[if gte mso [0-9]{1,2}\]>[\s\S]*?<!\[endif\]-->/ig, "");

    html = html.replace(/<style>[\s\S]*?mso[\s\S]*?<\/style>/ig, "");

    html = html.replace(/ lang=".+?"/ig, "");

    html = html.replace(/<o:p><\/o:p>/ig, "");

    html = html.replace(/ class="Mso.+?"/ig, "");
    
    html = html.replace(/ mso-spacerun: 'yes'/ig, "");
    return html;
}
js明哥哥 | 园豆:243 (菜鸟二级) | 2012-12-14 10:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册