release: v0.1.4 — parser enhancement, new syntax, performance optimization

feat(parser): comprehensive Markdown parser enhancement
- Add nested list support (multi-level unordered/ordered, mixed nesting)
- Add Setext headings (=== / ---)
- Add indented code blocks (4-space indent)
- Add HTML comment passthrough (<!-- -->)
- Add entity reference protection (&amp; &#169;)
- Add ordered list start attribute
- Add link title single-quote support
- Add LaTeX math formulas ($inline$ / $$block$$)
- Add footnote support ([^1] ref + [^1]: definition)
- Add definition lists (term\n: definition)
- Extend emoji map from 85 to 150+ common emojis
- Fix backtick code block matching (CommonMark spec)
- Fix italic regex character truncation (lookbehind assertions)
- Fix superscript/subscript/strikethrough ambiguity
- Fix blockquote prefix handling (>text without space)
- Enhance safeUrl filtering (additional protocol checks)
- Enhance slugify (Unicode NFKC normalization)

perf(parser): single-pass inline scanning, render cache, pre-compiled regex
- Replace 14-step chained regex with unified single-pass scanInline()
- Add cachedRenderInline() with FIFO LRU eviction (300-entry cap)
- Pre-compile 15+ static regex constants for block boundary detection
- Skip redundant style='text-align:left' on default-aligned table cells

style(parser): add CSS for footnotes, definition lists, math formulas, sup/sub

test(parser): 44 new test cases covering all v0.1.4 syntax additions (469 total)

chore: bump version 0.1.3 → 0.1.4 across all source files, docs, site pages
This commit is contained in:
2026-07-24 09:35:51 +08:00
parent 2eb86d29b6
commit f8b9f4a761
19 changed files with 1128 additions and 198 deletions
+27 -2
View File
@@ -313,9 +313,34 @@
'',
'| 名称 | 值 |',
'| --- | --- |',
'| 版本 | 0.1.3 |',
'| 版本 | 0.1.4 |',
'| 依赖 | 零 |',
'| 测试 | 390+ |',
'| 测试 | 469+ |',
'',
'## 新增语法',
'',
'### 数学公式',
'',
'- 行内:$E=mc^2$',
'- 块级:$$\\int_0^\\infty e^{-x}dx$$',
'',
'### 嵌套列表',
'',
'- 一级',
' - 二级',
' - 三级',
'',
'### 脚注',
'',
'这是带脚注的文字[^1]',
'',
'[^1]: 这是脚注内容',
'',
'### 定义列表',
'',
'Markdown',
': 一种轻量级标记语言。',
': 由 John Gruber 创建。',
'',
'## 任务列表',
'',
+2 -2
View File
@@ -175,7 +175,7 @@
<header class="docs-header">
<h1><span class="grad">文档</span></h1>
<p class="sub">MetonaEditor v0.1.3 完整 API、配置与使用指南</p>
<p class="sub">MetonaEditor v0.1.4 完整 API、配置与使用指南</p>
</header>
<div class="container">
@@ -598,7 +598,7 @@ i18nUtils<span class="c-punc">.</span><span class="c-fn">formatDate</span><span
<footer>
<div class="container">
MetonaEditor v0.1.3 · <a href="https://git.metona.cn/MetonaTeam/MetonaEditor" target="_blank" rel="noopener">源码仓库</a> · MIT License
MetonaEditor v0.1.4 · <a href="https://git.metona.cn/MetonaTeam/MetonaEditor" target="_blank" rel="noopener">源码仓库</a> · MIT License
</div>
</footer>
+2 -2
View File
@@ -467,8 +467,8 @@
<div class="feature-icon">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
</div>
<h3>内置轻量解析器</h3>
<p>自研 CommonMark 子集 + GFM 扩展解析器,覆盖标题、表格、任务列表、代码块等常用语法,也可整体替换。</p>
<h3>内置增强解析器</h3>
<p>自研 CommonMark + GFM 扩展解析器,覆盖数学公式、脚注、嵌套列表、定义列表、表格对齐、任务列表等丰富语法,也可整体替换。</p>
</div>
<div class="feature">
<div class="feature-icon">