Skip to content

Commit 427e99c

Browse files
committed
fix: disable HTML rendering in Markdown preview
1 parent ccc783a commit 427e99c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frontend/src/components/share/FilePreview.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import {
77
useMantineTheme,
88
} from "@mantine/core";
99
import { modals } from "@mantine/modals";
10+
import Markdown, { MarkdownToJSX } from "markdown-to-jsx";
1011
import Link from "next/link";
1112
import React, { Dispatch, SetStateAction, useEffect, useState } from "react";
1213
import { FormattedMessage } from "react-intl";
1314
import api from "../../services/api.service";
14-
import Markdown from "markdown-to-jsx";
1515

1616
const FilePreviewContext = React.createContext<{
1717
shareId: string;
@@ -132,7 +132,8 @@ const TextPreview = () => {
132132
.then((res) => setText(res.data ?? "Preview couldn't be fetched."));
133133
}, [shareId, fileId]);
134134

135-
const options = {
135+
const options: MarkdownToJSX.Options = {
136+
disableParsingRawHTML: true,
136137
overrides: {
137138
pre: {
138139
props: {

0 commit comments

Comments
 (0)