Skip to content

feat(parser): Integrate linkify into parser - #6

Open
Fuyeors wants to merge 1 commit into
mainfrom
feat/integrate-formatter
Open

feat(parser): Integrate linkify into parser#6
Fuyeors wants to merge 1 commit into
mainfrom
feat/integrate-formatter

Conversation

@Fuyeors

@Fuyeors Fuyeors commented Aug 22, 2026

Copy link
Copy Markdown
Member

介绍

@fuyeor/linkify 集成到 @fuyeor/markdown-parser 的纯文本 URL 自动识别流程中。

根据进一步确认:由于直接使用 linkify 不会增加任何兼容性失败,反而意外修复了原 parser 的两处误判,因此完全移除了旧的正则与括号平衡逻辑以减小包体积。

  • parser 默认使用共享的 linkify 实现,辅以轻量预检 (LINKIFY_CANDIDATE_REGEX) 优化性能。
  • 移除了 legacyLinkify 回退路径,代码更精简。
  • 新增 Linkifier 配置类型,允许注入自定义 linkifier。
  • 更新 Docker 与 CI,在 parser 类型检查和测试前构建 linkify 产物。
  • 新增国际化模糊域名回归测试(fuyeor.xn--p1ai -> fuyeor.рф)。

验证

已使用相同的 parser 兼容性测试和仓库现有 speed/memory benchmark 对集成前后进行比较。

  • 兼容性测试:失败用例从 365 个减少至 363 个(没有新增失败,意外修复了 <foo.bar.baz>2.two 两处误判)。
  • AST 解析吞吐量:50 Social Posts 从 1433 µs 提升至 1354 µs,Blog Posts 从 4828 µs 提升至 4573 µs(约 5% 的性能提升)。
  • 内存占用 (Heap Impact):Social 维持 0.14 MB,Blog 从 0.14 MB 变为 0.16 MB(维持在极低量级)。

提交作者为 Manus AI <bot+manus@fuyeor.com>

@Fuyeors
Fuyeors force-pushed the feat/integrate-formatter branch from 42e1327 to 48f9943 Compare August 22, 2026 12:41
@Fuyeors Fuyeors changed the title feat(parser): Integrate markdown formatter feat(parser): Integrate linkify into parser Aug 22, 2026
Use the shared linkify package for plain-text URL detection while retaining the historical matcher as a compatibility fallback. Build linkify before parser consumers in CI and Docker.
@Fuyeors
Fuyeors force-pushed the feat/integrate-formatter branch from 48f9943 to c3c31f6 Compare August 22, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant