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
+51 -1
View File
@@ -1,7 +1,7 @@
/**
* MetonaEditor Styles - 编辑器样式
* @module styles
* @version 0.1.3
* @version 0.1.4
* @description 编辑器 UI 样式注入与管理
*/
@@ -342,6 +342,56 @@ const generateCSS = () => {
border-radius: 3px;
}
/* ============ 上标/下标 ============ */
.me-preview sup { font-size: 0.75em; vertical-align: super; line-height: 1; }
.me-preview sub { font-size: 0.75em; vertical-align: sub; line-height: 1; }
/* ============ 数学公式 ============ */
.me-preview .me-math-block {
display: block;
margin: 1.2em 0;
padding: 12px 16px;
background: var(--md-code-bg);
border-radius: 8px;
overflow-x: auto;
font-family: var(--md-mono);
font-size: 0.95em;
text-align: center;
}
.me-preview .me-math-inline {
font-family: var(--md-mono);
font-size: 0.95em;
padding: 0.05em 0.2em;
}
/* ============ 定义列表 ============ */
.me-preview dl { margin: 0.8em 0; }
.me-preview dt { font-weight: 650; margin: 0.6em 0 0.2em; }
.me-preview dd { margin: 0 0 0.3em 1.6em; color: var(--md-text); }
/* ============ 脚注 ============ */
.me-preview .me-footnote-ref a {
font-size: 0.75em;
vertical-align: super;
text-decoration: none;
color: var(--md-accent);
}
.me-preview .me-footnotes {
margin-top: 2em;
border-top: 1px solid var(--md-border);
padding-top: 0.8em;
font-size: 0.9em;
color: var(--md-muted);
}
.me-preview .me-footnotes hr { display: none; }
.me-preview .me-footnotes ol { padding-left: 1.2em; }
.me-preview .me-footnote-item { margin: 0.3em 0; }
.me-preview .me-footnote-backref {
text-decoration: none;
color: var(--md-accent);
margin-right: 0.4em;
}
/* ============ 打印样式 ============ */
@media print {
.me-wrapper { border: 0 !important; box-shadow: none !important; }