remove dompurify

pull/7928/head
CarinaWolli 2023-03-24 12:59:40 +01:00
parent c6b46dfea5
commit 583bb623c7
1 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,6 @@ import { $createHeadingNode, $isHeadingNode } from "@lexical/rich-text";
import { $isAtNodeEnd, $wrapNodes } from "@lexical/selection";
import { $getNearestNodeOfType, mergeRegister } from "@lexical/utils";
import classNames from "classnames";
import DOMPurify from "dompurify";
import type { EditorState, GridSelection, LexicalEditor, NodeSelection, RangeSelection } from "lexical";
import {
$createParagraphNode,
@ -26,6 +25,8 @@ import {
import { useCallback, useEffect, useRef, useState } from "react";
import { createPortal } from "react-dom";
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
import { Button } from "../../button";
import { Dropdown, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../form/dropdown";
import { FiChevronDown } from "../../icon";
@ -353,7 +354,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
editor.registerUpdateListener(({ editorState, prevEditorState }) => {
editorState.read(() => {
const textInHtml = $generateHtmlFromNodes(editor).replace(/&lt;/g, "<").replace(/&gt;/g, ">");
props.setText(DOMPurify.sanitize(textInHtml));
props.setText(markdownToSafeHTML(textInHtml));
});
if (!prevEditorState._selection) editor.blur();
});