fix: deprecated

pull/170/head^2
xingyu4j 2025-07-09 17:18:07 +08:00
parent 26549ccfb8
commit bfd3a209f8
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ const md = new MarkdownIt({
if (lang && hljs.getLanguage(lang)) {
try {
const copyHtml = `<div id="copy" data-copy='${str}' style="position: absolute; right: 10px; top: 5px; color: #fff;cursor: pointer;">复制</div>`;
return `<pre style="position: relative;">${copyHtml}<code class="hljs">${hljs.highlight(lang, str, true).value}</code></pre>`;
return `<pre style="position: relative;">${copyHtml}<code class="hljs">${hljs.highlight(str, { language: lang, ignoreIllegals: true }).value}</code></pre>`;
} catch {}
}
return ``;