mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-15 07:26:48 +00:00
Merge pull request #205 from tangly1024/feature_code_highlight
C++、C#代码支持
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user