Skip to content

Commit 062d5e8

Browse files
Update src/pages/markdownPreview/index.js
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent c3e21b8 commit 062d5e8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pages/markdownPreview/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,10 @@ function createMarkdownPreview(file) {
402402
return;
403403
}
404404

405-
block.innerHTML = svg;
405+
const sanitizedSvg = DOMPurify.sanitize(svg, {
406+
USE_PROFILES: { svg: true, svgFilters: true },
407+
});
408+
block.innerHTML = sanitizedSvg;
406409
bindFunctions?.(block);
407410
} catch (error) {
408411
if (!block.isConnected) return;

0 commit comments

Comments
 (0)