fix: locate the bug (#233)

* fix: locate the bug

* fix: update regular expression

* fix #196
This commit is contained in:
YangQi 2023-07-29 12:17:46 +08:00 committed by GitHub
parent 6847c50091
commit 5f544291e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,8 +341,8 @@ export default {
clipboardDiv.innerHTML = mergeCss(clipboardDiv.innerHTML)
if (this.isMacCodeBlock) {
clipboardDiv.innerHTML = clipboardDiv.innerHTML.replaceAll(
/(<code class="prettyprint.+?(?<=style="))/g,
`$1font-family: Menlo, 'Operator Mono', Consolas, Monaco, monospace;`
/(<code class="prettyprint[^>]*)(style=")/g,
`$1style="font-family: Menlo, 'Operator Mono', Consolas, Monaco, monospace;`
)
}
clipboardDiv.focus()