em标签在html解析不了
来源:7-12 搜索结果 - 高亮搜索结果关键字

柠檬茶之
2022-11-26
老师你好,为什么em标签在html解析不了,要改成行内样式?
// 更改返回数据样式(行内样式)
res.list.forEach((item) => {
item.title = item.title.replace(/<em>/g, "<em style='color:#f94d2a; margin:0 2px'>");
item.description = item.description.replace(
/<em>/g,
"<em style='color:#f94d2a; margin:0 2px'>"
);
});
写回答
1回答
-
Sunday
2022-11-26
你好
这个是因为要实时高亮关键字呀。
00
相似问题