js中识别html标签外的空格 并替换为 (主要用于富文本)
文章目录
let content = row.content;
row.content = content.replace(/[^<>]+(?=<)/g, function (match) { return match.replace(/\s/g, ' '); }); let content = row.content;
row.content = content.replace(/[^<>]+(?=<)/g, function (match) { return match.replace(/\s/g, ' '); });
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论