我将一些内容从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();
});