diff --git a/components/details/details-content.tsx b/components/details/details-content.tsx index 785a421..26633be 100644 --- a/components/details/details-content.tsx +++ b/components/details/details-content.tsx @@ -22,6 +22,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"; @@ -271,6 +272,16 @@ export default function DetailContent() { close(); } + 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 }; + } + return ( <>