diff --git a/components/details/details-content.tsx b/components/details/details-content.tsx index aad4428..c7aad59 100644 --- a/components/details/details-content.tsx +++ b/components/details/details-content.tsx @@ -21,6 +21,7 @@ import { } from "@/service/master-user"; import { useForm } from "react-hook-form"; import { Badge } from "../ui/badge"; +import { formatTextToHtmlTag } from "@/utils/global"; type TabKey = "trending" | "comments" | "latest"; @@ -338,6 +339,16 @@ export default function DetailContent() { // // ); // } + + function removeImgTags(htmlString?: { __html: string }) { + const parser = new DOMParser(); + const doc = parser.parseFromString(String(htmlString?.__html), "text/html"); + + const images = doc.querySelectorAll("img"); + images.forEach((img) => img.remove()); + + return { __html: doc.body.innerHTML }; + } function decodeHtmlString(raw: string = "") { if (!raw) return ""; @@ -520,11 +531,10 @@ export default function DetailContent() {
Judul
+Judulss