fix: stability improvements — initialize _outlineTimer, extract INLINE_RE constant

- core.js: initialize this._outlineTimer = null in constructor (fixes clearTimeout(undefined))
- parser.js: extract INLINE_RE to module-level constant (avoid recompilation on every scanInline call)
This commit is contained in:
2026-07-24 11:26:10 +08:00
parent 5d9b934a2d
commit a44abea401
2 changed files with 22 additions and 33 deletions
+1
View File
@@ -109,6 +109,7 @@ class MarkdownEditor {
this._shortcuts = []; // v0.1.6: 快捷键注册表
this._contextMenuItems = []; // v0.1.6: 右键菜单项
this._customActions = {}; // 自定义工具栏动作
this._outlineTimer = null; // 大纲防抖计时器
// 渲染函数:自定义覆盖内置解析器
this._renderFn = (typeof this.config.render === 'function') ? this.config.render : parseMarkdown;