diff --git a/components/details/details-content.tsx b/components/details/details-content.tsx index aa107f3..ffb4398 100644 --- a/components/details/details-content.tsx +++ b/components/details/details-content.tsx @@ -20,6 +20,7 @@ import { import { saveActivity } from "@/service/activity-log"; import { useForm } from "react-hook-form"; import { Badge } from "../ui/badge"; +import { formatTextToHtmlTag } from "@/utils/global"; type TabKey = "trending" | "comments" | "latest"; @@ -231,6 +232,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 ( <>