我有一些HTML作为字符串 "<p>This is a slightly longer post about something. Let's see how long this lasts.</p><p></p><p>Let's write another paragraph, and see how it renders when I read this post late
我有一些带有css类的原始html,用于各种标记。示例:<p class="opener" itemprop="description">Lorem ipsum dolor sit amet, consectetur adipisicing</p>输出:
<p>Lorem ipsum dolor sit amet, consectetur adipisicing
我正在寻找一种使用NodeJS从后端的字符串中剥离标记的方法。这里有几个答案建议尝试,但是文档和任何答案都没有具体解释如何使用它。例如,在这样的变量中有一个字符串:var text = '<p><b>Hello there!= sanitize(large_input_str).xss();
var str = sanitize(