diff --git a/src/renderer/src/pages/home/Markdown/Markdown.tsx b/src/renderer/src/pages/home/Markdown/Markdown.tsx index c636b6d784..6ff47e57a8 100644 --- a/src/renderer/src/pages/home/Markdown/Markdown.tsx +++ b/src/renderer/src/pages/home/Markdown/Markdown.tsx @@ -34,7 +34,7 @@ import remarkDisableConstructs from './plugins/remarkDisableConstructs' import Table from './Table' const ALLOWED_ELEMENTS = - /<(style|p|div|span|b|i|strong|em|ul|ol|li|table|tr|td|th|thead|tbody|h[1-6]|blockquote|pre|code|br|hr|svg|path|circle|rect|line|polyline|polygon|text|g|defs|title|desc|tspan|sub|sup)/i + /<(style|p|div|span|b|i|strong|em|ul|ol|li|table|tr|td|th|thead|tbody|h[1-6]|blockquote|pre|code|br|hr|svg|path|circle|rect|line|polyline|polygon|text|g|defs|title|desc|tspan|sub|sup|details|summary)/i const DISALLOWED_ELEMENTS = ['iframe', 'script'] interface Props { diff --git a/src/renderer/src/utils/markdownConverter.ts b/src/renderer/src/utils/markdownConverter.ts index 4332813968..0b905689b8 100644 --- a/src/renderer/src/utils/markdownConverter.ts +++ b/src/renderer/src/utils/markdownConverter.ts @@ -625,7 +625,9 @@ export const sanitizeHtml = (html: string): string => { 'td', 'th', 'input', - 'label' + 'label', + 'details', + 'summary' ], ALLOWED_ATTR: [ 'href',