From 30384d09842c2822a92251ad0f498c41c5f08a8f Mon Sep 17 00:00:00 2001 From: Kagol Date: Fri, 20 Sep 2024 10:37:59 +0800 Subject: [PATCH] fix(fluent-editor): fix link/img render error (#2156) --- packages/renderless/src/common/xss.ts | 4 ++-- packages/theme/src/fluent-editor/index.less | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/renderless/src/common/xss.ts b/packages/renderless/src/common/xss.ts index 3ba14d943c..7f573decc2 100644 --- a/packages/renderless/src/common/xss.ts +++ b/packages/renderless/src/common/xss.ts @@ -22,7 +22,7 @@ let xssOptions = { enableUrl: true, html: { whiteList: { - a: ['class', 'style', 'contenteditable', 'data-id', 'data-title', 'data-size', 'data-last-modified'], + a: ['class', 'style', 'contenteditable', 'data-id', 'data-title', 'data-size', 'data-last-modified', 'href'], address: ['class', 'style'], area: ['class', 'style'], article: ['class', 'style'], @@ -74,7 +74,7 @@ let xssOptions = { header: ['class', 'style'], hr: ['class', 'style'], i: ['class', 'style', 'data-image-id', 'data-image'], - img: ['class', 'style', 'devui-editorx-image', 'style', 'data-image-id'], + img: ['class', 'style', 'devui-editorx-image', 'style', 'data-image-id', 'src'], input: ['class', 'style', 'data-formula', 'data-link', 'data-video'], ins: ['class', 'style'], li: ['class', 'style'], diff --git a/packages/theme/src/fluent-editor/index.less b/packages/theme/src/fluent-editor/index.less index d127b2481e..f9a2b33488 100644 --- a/packages/theme/src/fluent-editor/index.less +++ b/packages/theme/src/fluent-editor/index.less @@ -183,6 +183,7 @@ margin-right: 8px; svg { + width: 16px; font-size: 16px; }