Merge pull request #205 from tangly1024/feature_code_highlight

C++、C#代码支持
This commit is contained in:
tangly1024
2022-04-26 16:15:28 +08:00
committed by GitHub
2 changed files with 11 additions and 3 deletions

View File

@@ -49,6 +49,16 @@ function filterPostBlocks(id, pageBlock, slice) {
continue
}
count++
// 处理 c++ 和 c#两种语言
if (b?.value?.type === 'code') {
if (b?.value?.properties?.language?.[0][0] === 'C++') {
b.value.properties.language[0][0] = 'cpp'
}
if (b?.value?.properties?.language?.[0][0] === 'C#') {
b.value.properties.language[0][0] = 'csharp'
}
}
delete b?.role
delete b?.value?.version
delete b?.value?.created_by_table

View File

@@ -8,9 +8,7 @@ import '@/styles/notion.css' // 重写部分样式
// used for collection views (optional)
// import 'rc-dropdown/assets/index.css'
// used for code syntax highlighting (optional)
import 'prismjs/themes/prism-okaidia.css'
// used for rendering equations (optional)
import 'prismjs/themes/prism-tomorrow.min.css'
import 'react-notion-x/build/third-party/equation.css'
import dynamic from 'next/dynamic'