Skip to content

Commit

Permalink
fix: 修复报错
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeD3 committed Jan 31, 2023
1 parent 98b79fd commit 6c42c19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions frontend/components/ArticlesContent/highlightStyle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const highlight = (await import('~~/assets/highlight')).highlight
import { highlight } from '~~/assets/highlight'

export default function highlightStyle() {
return {
viewerEffect({ file }: any) {
Expand All @@ -9,8 +10,8 @@ export default function highlightStyle() {
const hlStyle = highlight[hl]
if (hlStyle) { $style.innerHTML = hlStyle }
else {
$style.innerHTML = highlight['atom-one-dark']
hl = 'atom-one-dark'
$style.innerHTML = highlight.default
hl = 'default'
}
const markdownBody = document.querySelector('.markdown-body')
markdownBody?.insertBefore($style, markdownBody.firstChild)
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/ArticlesContent/themeStyle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const themes = (await import('~~/assets/themes')).themes
import { themes } from '~~/assets/themes'
export default function themeStyle() {
return {
viewerEffect({ file }: any) {
Expand Down

0 comments on commit 6c42c19

Please sign in to comment.