diff --git a/site/docs.html b/site/docs.html index 9d776e5..9bca68b 100644 --- a/site/docs.html +++ b/site/docs.html @@ -262,9 +262,9 @@ locale: 'zh-CN', // 'zh-CN' | 'en-US' | 自定义 // 自定义渲染 - render: null, // (md, env) => html - highlight: null, // (code, lang) => html - sanitize: null, // (html) => safeHtml + render: null, // (md, env) => html + highlight: null, // (code, lang) => html + sanitize: null, // (html) => safeHtml // 外观 className: '', // 容器额外 class @@ -272,15 +272,15 @@ // 插件与回调 plugins: [], // 实例级插件数组 - onChange: null, // (value, editor) => void - onInput: null, // (value, editor) => void - onFocus: null, // (editor) => void - onBlur: null, // (editor) => void - onSave: null, // (value, editor) => void - onModeChange: null, // (mode, editor) => void - onFullscreen: null, // (fullscreen, editor) => void - onCreate: null, // (editor) => void - onDestroy: null, // (editor) => void + onChange: null, // (value, editor) => void + onInput: null, // (value, editor) => void + onFocus: null, // (editor) => void + onBlur: null, // (editor) => void + onSave: null, // (value, editor) => void + onModeChange: null, // (mode, editor) => void + onFullscreen: null, // (fullscreen, editor) => void + onCreate: null, // (editor) => void + onDestroy: null, // (editor) => void }); @@ -372,10 +372,10 @@ editor.isFullscreen

统计与状态

editor.getStats();
-// => { characters, words, chineseChars, englishWords, lines, readingTime }
+// => { characters, words, chineseChars, englishWords, lines, readingTime }
 
 editor.getStatus();
-// => { id, mode, theme, locale, fullscreen, readOnly, disabled, destroyed, plugins }
+// => { id, mode, theme, locale, fullscreen, readOnly, disabled, destroyed, plugins }
@@ -445,7 +445,7 @@ MeEditor.use.use(customPlugin); // 全局事件钩子 -MeEditor.on('beforeCreate', (editor) => {}); +MeEditor.on('beforeCreate', (editor) => {}); MeEditor.off('beforeCreate', handler); // 主题与语言 @@ -453,16 +453,16 @@ MeEditor.setTheme.setLocale('en-US'); // 状态查询 -MeEditor.getStatus(); // => { version, theme, locale, globalPlugins, presetPlugins } +MeEditor.getStatus(); // => { version, theme, locale, globalPlugins, presetPlugins } // 销毁全局资源 MeEditor.destroy(); // 内置解析器 import { parseMarkdown, safeUrl, slugify } from '@metona-team/metona-editor'; -parseMarkdown('# Hello'); // => '<h1 id="hello">Hello</h1>' -safeUrl('javascript:alert(1)'); // => '' -slugify('Hello World'); // => 'hello-world' +parseMarkdown('# Hello'); // => '<h1 id="hello">Hello</h1>' +safeUrl('javascript:alert(1)'); // => '' +slugify('Hello World'); // => 'hello-world'
@@ -580,16 +580,16 @@ MeEditor.setLocale// 翻译函数 import { i18nUtils } from '@metona-team/metona-editor'; -i18nUtils.t('bold'); // => '粗体'(zh-CN) -i18nUtils.t('bold'); // => 'Bold'(en-US) +i18nUtils.t('bold'); // => '粗体'(zh-CN) +i18nUtils.t('bold'); // => 'Bold'(en-US) // 添加语言 i18nUtils.addTranslations('ja', { bold: '太字', italic: '斜体' }); // 格式化 -i18nUtils.formatNumber(1234567); // => '1,234,567' -i18nUtils.formatCurrency(99.99, 'USD'); // => '$99.99' -i18nUtils.formatDate('2024-01-15'); // => '1/15/2024' +i18nUtils.formatNumber(1234567); // => '1,234,567' +i18nUtils.formatCurrency(99.99, 'USD'); // => '$99.99' +i18nUtils.formatDate('2024-01-15'); // => '1/15/2024'