refactor: consolidate block processing logic

Introduce a centralized `block-processor` and `block-scanner` to
handle markdown fenced code blocks. This replaces the previous
`inline-blocks.ts` and individual completion sources with a unified
approach that handles block stripping, directive replacement, and
metadata extraction (stats, templates, and spark tables) in a single
pass.
This commit is contained in:
2026-07-09 10:56:54 +08:00
parent 1c69bf394c
commit a4cfcde613
10 changed files with 358 additions and 379 deletions
+2 -2
View File
@@ -234,10 +234,10 @@ weather,天气,enum,晴天\|阴天\|雨天\|暴风雨
模板属性用于查表掷骰,例如年龄表、职业表等。
模板在独立的 CSV 代码块中定义,使用 `role=stat-template` 和 `file=模板名`。
模板在独立的 CSV 代码块中定义,使用 `role=stat-template` 和 `id=模板名`。
**第一列是骰子表达式**(如 `1d10`),第二列是 `label`,其余列为修饰符:
```csv role=stat-template file=年龄
```csv id=年龄 role=stat-template
1d10,label,heart,mind,strength,speed
1-3,青少年,+20,-10,,
4-7,成年,,-10,,+20