ui: mdeditor: add zh-TW

This commit is contained in:
undefined committed 2026-03-04 02:44:00 +08:00
1 parent eab9b9e8f2
commit ff8345cf96
3 files changed
+8

No files matched your search

@@ -176,6 +176,7 @@ export default class Editor extends DOMAttachedObject {
ref={renderCallback}
value={val}
theme={getTheme()}
language={UserContext.viewLang === 'zh' ? 'zh-CN' : UserContext.viewLang?.replace('_', '-')}
noMermaid
noPrettier
noKatex
@@ -1,5 +1,6 @@
import 'md-editor-rt/lib/style.css';
import zh_TW from '@vavt/cm-extension/dist/locale/zh-TW';
import Anchor from 'markdown-it-anchor';
import Footnote from 'markdown-it-footnote';
import Mark from 'markdown-it-mark';
@@ -43,6 +44,11 @@ config({
codeMirrorExtensions(extensions) {
return extensions.filter((i) => i.type !== 'linkShortener');
},
editorConfig: {
languageUserDefined: {
'zh-TW': zh_TW,
},
},
});
export { MdEditor };
+1
View File
@@ -41,6 +41,7 @@
"@types/redux-logger": "^3.0.13",
"@types/uuid": "^11.0.0",
"@types/webpack-env": "^1.18.8",
"@vavt/cm-extension": "^1.11.2",
"@vscode/codicons": "^0.0.44",
"ajv": "^8.18.0",
"allotment": "^1.20.5",