Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Jul 4, 2024
1 parent fd5939f commit c36c315
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
3 changes: 1 addition & 2 deletions src/assets/scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ export function exportHTML() {
// 判断是否是包裹代码块的 code 元素
function isCode(element) {
return (

Check failure on line 287 in src/assets/scripts/util.js

View workflow job for this annotation

GitHub Actions / build-preview

Replace `(⏎········element.tagName·===·`CODE`⏎······)` with `element.tagName·===·`CODE``
element.tagName === `CODE` &&
Array.from(element.classList).includes(`prettyprint`)
element.tagName === `CODE`
)
}

Expand Down
7 changes: 0 additions & 7 deletions src/components/CodemirrorEditor/EditorHeader/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,6 @@ export default {
)
// 公众号不支持 position, 转换为等价的 translateY
.replace(/top:(.*?)em/g, `transform: translateY($1em)`)
if (this.isMacCodeBlock) {
clipboardDiv.innerHTML = clipboardDiv.innerHTML.replaceAll(
/(<code class="prettyprint[^>]*)(style=")/g,
`$1style="font-family: Menlo, 'Operator Mono', Consolas, Monaco, monospace;`
)
}
clipboardDiv.focus()
window.getSelection().removeAllRanges()
let range = document.createRange()
Expand Down
2 changes: 0 additions & 2 deletions src/views/CodemirrorEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ export default {
onEditorRefresh() {
this.codeThemeChanged(this.codeTheme)
this.editorRefresh()
setTimeout(() => window.PR.prettyPrint(), 0)
},
// 复制结束
endCopy() {
Expand Down Expand Up @@ -607,7 +606,6 @@ export default {
mounted() {
setTimeout(() => {
this.leftAndRightScroll()
window.PR.prettyPrint()
}, 300)
},
setup() {
Expand Down

0 comments on commit c36c315

Please sign in to comment.