mirror of
https://github.com/swissmakers/swiss-datashare.git
synced 2026-03-30 05:27:03 +02:00
fix: disable HTML rendering in Markdown preview
This commit is contained in:
@@ -7,11 +7,11 @@ import {
|
|||||||
useMantineTheme,
|
useMantineTheme,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { modals } from "@mantine/modals";
|
import { modals } from "@mantine/modals";
|
||||||
|
import Markdown, { MarkdownToJSX } from "markdown-to-jsx";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import React, { Dispatch, SetStateAction, useEffect, useState } from "react";
|
import React, { Dispatch, SetStateAction, useEffect, useState } from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
import api from "../../services/api.service";
|
import api from "../../services/api.service";
|
||||||
import Markdown from "markdown-to-jsx";
|
|
||||||
|
|
||||||
const FilePreviewContext = React.createContext<{
|
const FilePreviewContext = React.createContext<{
|
||||||
shareId: string;
|
shareId: string;
|
||||||
@@ -132,7 +132,8 @@ const TextPreview = () => {
|
|||||||
.then((res) => setText(res.data ?? "Preview couldn't be fetched."));
|
.then((res) => setText(res.data ?? "Preview couldn't be fetched."));
|
||||||
}, [shareId, fileId]);
|
}, [shareId, fileId]);
|
||||||
|
|
||||||
const options = {
|
const options: MarkdownToJSX.Options = {
|
||||||
|
disableParsingRawHTML: true,
|
||||||
overrides: {
|
overrides: {
|
||||||
pre: {
|
pre: {
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
Reference in New Issue
Block a user