减少 hljs 的体积

This commit is contained in:
2025-02-26 15:06:39 +08:00
parent db87a1d675
commit 24db30ccec
2 changed files with 17 additions and 6 deletions

View File

@@ -57,7 +57,7 @@ function addButton() {
const match = code.className.match(/-(.*)/)
let lang = "html"
if (match) lang = match[1].toLowerCase()
copy.innerHTML = `<span class="lang">${lang}</span><div class="btn">替换<div>`
copy.innerHTML = `<span class="lang">${lang.toUpperCase()}</span><div class="btn">替换<div>`
const btn = copy.children[1] as HTMLDivElement
btn.onclick = () => {
tab.value = lang
@@ -144,5 +144,6 @@ watch(step, render)
padding: 1rem;
cursor: pointer;
border-radius: 0.4rem;
font-size: 1rem;
}
</style>