We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35e71de commit 6da3425Copy full SHA for 6da3425
src/components/common/MarkdownRender.tsx
@@ -30,6 +30,10 @@ export interface MarkdownRenderProps {
30
editing?: boolean;
31
}
32
33
+function sanitizeEventScript(htmlString: string) {
34
+ return htmlString.replace(/ on\w+="[^"]*"/g, '');
35
+}
36
+
37
const MarkdownRenderBlock = styled.div`
38
&.atom-one {
39
${prismThemes['atom-one']}
@@ -123,7 +127,8 @@ const MarkdownRenderBlock = styled.div`
123
127
`;
124
128
125
129
function filter(html: string) {
126
- return sanitize(html, {
130
+ const presanitized = sanitizeEventScript(html);
131
+ return sanitize(presanitized, {
132
allowedTags: [
133
'h1',
134
'h2',
0 commit comments