过滤所有html标签,提取内容。

102 阅读1分钟
前言

需求里有漏洞,富文本内容没有专门服务去做内容处理和提取,所以只能前端去处理。

代码
const noTagContent = content.replace(/<\/?.+?>/g, '')
结束语

觉得不错的,还请点个赞,谢谢!