Fixed no shortcode
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { marked } from "marked";
|
||||
import DOMPurify from "dompurify";
|
||||
import DOMPurify from "isomorphic-dompurify";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Bold, Italic, Link, Strikethrough, Underline } from "lucide-react";
|
||||
import { Bold, Italic, Strikethrough, Underline } from "lucide-react";
|
||||
|
||||
enum Command {
|
||||
Italic = "*",
|
||||
@@ -79,6 +79,8 @@ export default function NewBlog() {
|
||||
moveCursor(cursor.column + 2);
|
||||
};
|
||||
|
||||
const sanitized = DOMPurify.sanitize(marked(text, { async: false }));
|
||||
|
||||
return (
|
||||
<section className="flex">
|
||||
<div>
|
||||
@@ -133,7 +135,8 @@ export default function NewBlog() {
|
||||
<div
|
||||
className="mt-4 p-2 bg-gray-100 border rounded-md text-sm text-black"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: DOMPurify.sanitize(marked(text, { async: false })),
|
||||
// @ts-ignore
|
||||
__html: sanitized,
|
||||
}}
|
||||
></div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user