Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

## Unreleased

## 0.2.2

### Changed

- source-map validation 工作流(打包 parser 产物并安装到 lint-md/core 跑全量测试)新增 `pull_request` 触发,限定高风险路径(`src/**`、`etc/**`、`package.json`、`scripts/test-package.mjs`);docs-only 等 PR 不再运行该验证。保留每周 cron 与手动触发作为安全网,覆盖 core 自身依赖变动造成的破坏(#105)

### Perf

- `getSourceRange()` range query 复用已解析的 segment index,每次 range query 从 4 次二分查找降为 2 次(#108)
- `parseMdWithSourceMap()` 延迟构建 `lineStarts`,`getRaw()`-only 调用方不再触发 Markdown 全文扫描和 `number[]` 分配(#109)
- `getSourceRange()` 延迟构建 `sourceGapPrefix`,仅在多 segment range query 时构建并缓存(#110)
- 消除 inline code、code segment 和 URL mapping 验证过程中的临时字符串和数组重建:`[...interior]` spread → `charCodeAt` 循环,`sourceValue` 拼接 → `equalRange` 逐字符比较,`value` 拼接 → `startsWith` 增量验证(#111)

### Tests

- 将 52 KB 的 `__tests__/source-map.spec.ts`(1273 行、150 用例)拆分为 `__tests__/source-map/` 下按功能域组织的 9 个 spec:supported-fields、text、inline-code、code、url、range-contract、ownership、errors、ast-parity。describe 标题逐字保留,测试体逐字搬运(仅调整 import 路径);用例总数与断言不变,零运行时行为变更、零公开 API 变更。原有的 differential / invariants / edge-cases / fixer-integration 四个 spec 不受影响(#106)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lint-md/parser",
"version": "0.2.1",
"version": "0.2.2",
"description": "lint-md 的解析器,基于 remark 生态,将 Markdown 字符串转换成 AST",
"author": "yuzhanglong <loveyzl1123@gmail.com>",
"contributors": [
Expand Down