从标签中去除字符串的最快(性能)方法是什么,我尝试过的大多数解决方案都使用正则表达式,但不会为属性内的标签生成正确的值(是的,我知道这是错误的),示例测试用例:
var str = "<div data-content='yo! press this: <br/> <button type=\"button\"><i class=\"glyphicon glyphicon-disk\"></i> Save</button>' data-title='<div>this one for tooltips <div>seriously</div></div>'> this is the real content<div> with another nested</div></div>"
这应该导致:
this is the real content with another nested