Skip to content

Commit

Permalink
fix: resolve warnings for katex custom components
Browse files Browse the repository at this point in the history
  • Loading branch information
Locietta committed May 2, 2023
1 parent 6c06505 commit 66f977b
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .vitepress/config.ts
Expand Up @@ -2,6 +2,7 @@ import { defineConfigWithTheme } from 'vitepress'
import mk from './theme/markdown-it-katex'
import img_fig from './theme/markdown-it-img-figure'
import { getPosts, generatePaginationPages } from './theme/server_utils'
import custom_components from './theme/custom_component'

export default async () => {
const pageSize = 6
Expand Down Expand Up @@ -59,6 +60,13 @@ export default async () => {

socialLinks: [{ icon: 'github', link: 'https://github.com/Locietta/blog-lost-pieces' }]
},
srcExclude: ['README.md']
srcExclude: ['README.md'],
vue: {
template: {
compilerOptions: {
isCustomElement: (tag) => custom_components.includes(tag)
}
}
}
})
}
91 changes: 91 additions & 0 deletions .vitepress/theme/custom_component.ts
@@ -0,0 +1,91 @@
/// custom components need to be injected into vite's build options

const custom_components = [
'math',
'maction',
'maligngroup',
'malignmark',
'menclose',
'merror',
'mfenced',
'mfrac',
'mi',
'mlongdiv',
'mmultiscripts',
'mn',
'mo',
'mover',
'mpadded',
'mphantom',
'mroot',
'mrow',
'ms',
'mscarries',
'mscarry',
'mscarries',
'msgroup',
'mstack',
'mlongdiv',
'msline',
'mstack',
'mspace',
'msqrt',
'msrow',
'mstack',
'mstack',
'mstyle',
'msub',
'msup',
'msubsup',
'mtable',
'mtd',
'mtext',
'mtr',
'munder',
'munderover',
'semantics',
'math',
'mi',
'mn',
'mo',
'ms',
'mspace',
'mtext',
'menclose',
'merror',
'mfenced',
'mfrac',
'mpadded',
'mphantom',
'mroot',
'mrow',
'msqrt',
'mstyle',
'mmultiscripts',
'mover',
'mprescripts',
'msub',
'msubsup',
'msup',
'munder',
'munderover',
'none',
'maligngroup',
'malignmark',
'mtable',
'mtd',
'mtr',
'mlongdiv',
'mscarries',
'mscarry',
'msgroup',
'msline',
'msrow',
'mstack',
'maction',
'semantics',
'annotation',
'annotation-xml'
]

export default custom_components

0 comments on commit 66f977b

Please sign in to comment.