Repository navigation
feat: add tinylinkify, GFM links in plain text and a linkify-it drop-in - #35
Conversation
…s, and teach tinyswap linkify-it
…a test that stops at the first link, and searches gated on what they need Adds the named LinkifyIt export markdown-exit 2 and linkify-it 6 use, keeps the links of a tested text for the match after it, and skips each search when the text lacks the characters its links need. The root's budget rises to 1,870 B and /gfm's to 2,300 B for that code.
… made them A Codex review found four ways the shortcuts in match and the validators could differ from linkify-it: a pattern recompiled or given its own methods in place, lastIndex left as it was when a search was skipped, and the TLD check converting a non-string a second time. Each shortcut now checks the pattern's source, flags and built-in methods, resets lastIndex first, and takes strings only; the fuzzer runs each of the reviewer's cases. The drop-in's budget rises to 4,030 B for the checks.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
tinyaml
tinyini
tinyjson5
tinylinkify
tinyswap
commit: |
There was a problem hiding this comment.
Important
Rejected URL candidates can make the GFM scanner block the event loop for seconds on an 80 KB message. This affects both the plain-text API and Markdown rendering and should be fixed before merging.
Reviewed changes — Reviewed all nine commits introducing tinylinkify and its repository integrations.
- GFM recognition and integration: Adds the plain-text
find/testAPI, thetinylinkify/gfmadapter, and thelinkifyGfmplugin for markdown-it and markdown-exit. - linkify-it replacement: Adds the version 4/5-compatible entry with configurable schemas, TLDs, normalization, engine-derived Unicode punctuation, and guarded search optimizations.
- Migration support: Registers linkify-it in tinyswap, including dependency replacement, import rewriting, and migration tests.
- Verification and publication: Adds upstream suites, differential fuzzers, distribution tests, packaging, size checks, and benchmarks.
- Documentation and tooling: Adds documentation pages, navigation, branding, comparison tables, and partial benchmark regeneration; updates the workspace lockfile.
Validation passed for tinylinkify's source and distribution tests (32 each), build/publint, lint/type checks, tinyswap's tests (153) and type check, and the documentation build. The size check reported tinylinkify/gfm is 2311 B gzip, over its budget of 2300 B on this runner; that small, zlib-dependent overage is not included as a defect finding.
gpt-6.1-sol(xhigh) | 𝕏
Latest result Merged 78b8718 directly: required checks passed and review threads were resolved. Final answersSession Merged 78b8718 directly: required checks passed and review threads were resolved. Pushed 78b8718 fixing the reported P1 quadratic scanning in both GFM recognition passes and resolved the review thread. Added scaling, Markdown rendering, and later-link offset regressions. All 24 focused tests and lint pass; 19,983 fuzz inputs match remark-gfm. Broader test wrappers encountered sandbox spawnSync EPERM errors. Awaiting hosted CI and automated review. |
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes — Re-reviewed 78b8718, the rejected-URL scanning fix added since the previous review at 17e35ec.
- Bounded domain retries: Cached invalid final-label boundaries to avoid repeatedly scanning the same rejected domain suffix.
- Deferred fallback suffix scans: Validated hosts before scanning paths and skipped equivalent rejected candidates while preserving later valid links.
- Added regression coverage: Exercised rejected-input scaling through
find,test, and markdown-exit, plus subsequent-link offsets.
Validation passed: 35 source tests, 35 distribution tests, build/publint, and lint/type checks. Another 59,962 fuzzed inputs and 12,960 targeted cases matched remark-gfm. The original 80 KB reproducer now used approximately 15–44 ms of CPU across the built public paths, versus roughly 11 seconds previously.
gpt-6.1-sol(xhigh) | 𝕏
…www. (#36) With fuzzyLink off, every www match was turned down, and each one read the rest of its host again: 80 KB took 3.7 seconds. The search now has no www to find then. The fix for rejected candidates in #35 grew the root and tinylinkify/gfm past their size budgets, by about 120 B gzip, so the budgets go to 1985 B and 2460 B and the sizes in the docs to match.

markdown-exit 2 and markdown-it 15 use linkify-it 6, which doesn't link
www.example.com, and GitHub and remark-gfm do. Moving a chat app from remark to markdown-exit loses those links. serkodev/markdown-exit#48 tried to fix it inside markdown-exit, and the maintainer would rather it lived in a separate package, so here it is.This adds
tinylinkify, with three entries:tinylinkify:findandtestfor GFM autolink literals, the way remark-gfm finds them. 1.8 KiB gzip against 4.1 KiB for linkify-it 5.0.2, and about 2.8× faster.tinylinkify/linkify-it: a drop-in for linkify-it 4 and 5. It's 4.11 → 3.90 KiB and passes 176 of 176 of linkify-it's own tests. tinyswap now migrates linkify-it to it.tinylinkify/gfm: linkify-it's interface with GFM's rules, for markdown-it and markdown-exit, plus a plugin:With it, markdown-exit links the same as remark-gfm on 98 of 98 chat messages, where linkify-it 6 gets 83.
The fuzzers found 0 differences: 6,002,040 calls against linkify-it, with Unicode punctuation from the engine, and 69,935 lines against remark-gfm's autolink step. Every place it still differs is listed under "what's different" in the README and on the compatibility page. One of them: in CommonJS TypeScript,
import LinkifyIt = require(...)can't nameLinkifyIt.Options, so importOptionsby name instead. A.d.ctswould fix it, and I left that for later.pnpm readypasses inpackages/tinylinkify, and tinyswap's tests pass. AMD Ryzen 7 255, Node 24.21.0, Linux.Related: serkodev/markdown-exit#48, serkodev/markdown-exit#47
Reviewed with sol-loop: 2 rounds with gpt-6.1-sol on xhigh. Sol verdict: approved