Skip to content

Commit

Permalink
chore(fe): follow dompurify changed import method
Browse files Browse the repository at this point in the history
  • Loading branch information
jimin9038 committed Jan 4, 2025
1 parent 23be400 commit f9e7731
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { convertToLetter } from '@/libs/utils'
import compileIcon from '@/public/icons/compile-version.svg'
import type { ProblemDetail } from '@/types/type'
import { sanitize } from 'isomorphic-dompurify'
import DOMPurify from 'isomorphic-dompurify'
import { FileText } from 'lucide-react'
import Image from 'next/image'
import CopyButton from './CopyButton'
Expand Down Expand Up @@ -131,7 +131,9 @@ export function EditorDescription({
</AccordionTrigger>
<AccordionContent>
<pre
dangerouslySetInnerHTML={{ __html: sanitize(problem.hint) }}
dangerouslySetInnerHTML={{
__html: DOMPurify.sanitize(problem.hint)
}}
className="prose prose-invert max-w-full whitespace-pre-wrap break-keep text-sm leading-relaxed text-slate-300"
/>
</AccordionContent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from '@/libs/utils'
import { sanitize } from 'isomorphic-dompurify'
import DOMPurify from 'isomorphic-dompurify'

export function WhitespaceVisualizer({
text = '',
Expand Down Expand Up @@ -37,7 +37,7 @@ export function WhitespaceVisualizer({
className
)}
dangerouslySetInnerHTML={{
__html: sanitize(
__html: DOMPurify.sanitize(
isTruncated ? truncatedText : highlightedWhitespaceText
)
}}
Expand Down

0 comments on commit f9e7731

Please sign in to comment.