mavonEditor icon indicating copy to clipboard operation
mavonEditor copied to clipboard

[Question] 请问如何避免将我需要展示的代码块中的html标签转义

Open hengtop opened this issue 2 years ago • 2 comments

💬 Questions and Help

我是用的式vue3beta版,但是我开起了xssOptions后,白名单外的所有标签都会被转义,但实际上代码块中的html标签是不需要转义的,否则我显示出来的就是实体字符。 我的xssOptions配置如下: const xssOptions = { whiteList: { img: ['src', 'alt', 'width', 'height', 'style'], span: ['style'], p: ['class', 'width', 'height', 'style'], pre: [], code: [] } };

以下是开启xss的效果,希望能帮我解决这个问题 image

hengtop avatar Mar 12 '22 18:03 hengtop

请问后续有解决该问题吗?

b1tzer avatar Aug 08 '23 02:08 b1tzer

请问后续有解决该问题吗?

这问题问了好久了,翻了好一会儿git log找到我当初怎么处理的了,我最后直接什么都没设置 传递了个空对象 const xssOptions = {};

hengtop avatar Aug 08 '23 04:08 hengtop