Skip to content

Commit 152edc1

Browse files
committed
Fix: Ignore unescaped HTML warning in highlight.js
1 parent 56b60fc commit 152edc1

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

content.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ function highlightCodeBlocks() {
135135
}
136136
}
137137
})
138+
// Configure highlight.js to ignore unescaped HTML warning
139+
hljs.configure({ ignoreUnescapedHTML: true })
138140
hljs.highlightAll()
139141
}
140142

popup.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ function IndexPopup() {
3737
// Apply highlight to the preview block on render
3838
useEffect(() => {
3939
if (codeRef.current) {
40+
// Configure highlight.js to ignore unescaped HTML warning
41+
hljs.configure({ ignoreUnescapedHTML: true })
42+
4043
// We must reset the DOM in case highlight.js already ran
4144
codeRef.current.removeAttribute("data-highlighted")
4245
codeRef.current.className = "language-javascript"

0 commit comments

Comments
 (0)