word粘贴html内容,如何从word中替换粘贴到htmleditor中的这些标记

我将一些内容从word粘贴到htmleditor()【http://mindmup.github.io/bootstrap-wysiwyg/】,但是一些单词定义的标签仍然在html中,如“< v:shape>< / v:shape>”和“< v:shapetype>< / v:shapetype>”和“< v:imagedata>< / v:imagedata>”等等...

除了这种标签之外,我已经用jquery删除了大部分无用的标签。

以下所有内容都不起作用,例如$(xxxxxx).find('v')/.find('v:shape')/.find('shape');。但$(xxxxxx).find('a')/.find('span')效果很好。

我想使用正则表达式将所有< v:xxx>< /v:xxx>标签替换为< vword>< /vword>然后删除所有vword标签,但我不知道正则表达式语法,在这两天我没有时间学习它和我想知道这是否正确。

那么,谁能告诉我应该怎么做以及应该做什么? THX。

这很有效:

container.find("font").each(function () {

$(this).replaceWith(function () { return $(this).contents(); });

});

这不起作用:

container.find("v").each(function () {

$(this).remove();

});

container.find("shape").each(function () {

$(this).remove();

});

container.find("shapetype").each(function () {

$(this).remove();

});

container.find("v:shape").each(function () {

$(this).remove();

});

container.find("v:shapetype").each(function () {

$(this).remove();

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值