Fix Markdown integration gaps within bundle budgets #17
main fromtaren/release-markdown-integrations·merged by tannerlinsley Changes#
- Forward code-fence metadata to
pre[data-meta]and highlighter options in HTML, React, and Octane. - Support portable inline component nodes through the existing component maps and HTML hooks.
- Add an opt-in URL policy callback with the default sanitized result and explicit rejection, without changing the default policy.
- Use single-pass attribute escaping and expand regression tests, documentation, and shipped skills.
The Changeset schedules @tanstack/markdown@0.0.15. This adds no runtime dependencies. Main renderer bundles grow 74-78 gzip bytes, about 1.1%, with exact minified, gzip, and Brotli ceilings enforced for all 22 measured entries. Standalone extensions are unchanged.
Compatibility notes: metadata-bearing code fences gain an escaped data-meta attribute, and exhaustive InlineNode switches need an inlineComponent case. Math stays outside the core. URL callback results are trusted and do not apply to raw HTML or supplied ASTs.
Validation#
pnpm run changeset:status: one patch release.pnpm run verify: 245 tests, typecheck, build, documentation, shipped skills, conformance, size budgets, benchmarks, and package dry-run pass.pnpm run corpus:audit:external: 10,517 Markdown files across 20 pinned repositories, no parser/determinism errors or unexplained target-profile content differences.- Revision comparisons retain all 403 passing CommonMark examples and show no new content differences across 16,825 external and TanStack files under both profiles.
- Repeated warmed benchmarks show no consistent end-to-end slowdown; no speedup claim is made.
The corpus text-extraction helper now strips markup before decoding entities, so escaped code and metadata are not mistaken for HTML. Updated reports reflect that accounting correction, not new parser regressions.
Summary by CodeRabbit#
New Features
- Added support for inline components across HTML, React, and Octane rendering, including nested inline content and configurable fallback tags.
- Added configurable URL policies for links and images, including approved replacements or removal of unsafe destinations.
- Code-fence metadata is now available to highlighters and exposed as
data-metaon rendered code blocks.
Bug Fixes
- Improved attribute escaping, including backticks, and strengthened URL and metadata handling across renderers.
Documentation
- Expanded guidance for URL policies, inline components, fence metadata, extensions, security, and performance.
- 1
tannerlinsley merged thiseb6ef72
tannerlinsley closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
4b5a5578-a5f7-4be9-a0e3-ad6ff81e701f📥 Commits
Reviewing files that changed from the base of the PR and between fca831e2ed9f3d4f0dab0755dd9dbad91a6b6433 and fe3e4638fcf131d080380ce5720ef7ba873740d7.
📒 Files selected for processing (37)
.changeset/portable-markdown-integrations.mdREADME.mddocs/comparison.mddocs/core-concepts/security.mddocs/guides/extensions.mddocs/guides/performance.mddocs/guides/syntax-highlighting.mddocs/overview.mddocs/reference/parser.mddocs/reference/types.mdreports/benchmarks.jsonreports/benchmarks.mdreports/conformance.jsonreports/conformance.mdreports/external-corpus.jsonreports/external-corpus.mdreports/sizes.jsonreports/sizes.mdscripts/audit-corpus.tsscripts/conformance-data.tsskills/custom-extensions/SKILL.mdskills/docs-features/references/docs-metadata.mdskills/production-pipelines/SKILL.mdskills/render-markdown/references/ast-and-options.mdsrc/html.tssrc/inline.tssrc/octane.tssrc/react.tssrc/types.tssrc/utils.tstests/audit-regressions.test.tsxtests/bundle-size.test.tstests/corpus-audit.test.tstests/inline-component.types.tstests/issue-regressions.test.tsxtests/markdown.test.tsxtests/url-policy.test.tsxIncluded review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.
📝 Walkthrough
Walkthrough#
Changes#
The Markdown AST now supports portable inline components, configurable URL filtering, and code-fence metadata forwarding across HTML, React, and Octane renderers. Escaping, regression coverage, documentation, bundle budgets, and generated reports were updated.
Portable markdown integrations
src/types.ts,src/html.ts,src/react.ts,src/octane.ts,docs/...,skills/...,tests/...InlineComponentNodeto the inline AST and renders inline children with renderer component mappings.src/types.ts,src/inline.ts,docs/...,skills/...,tests/url-policy.test.tsxurlTransformfor policy-processed Markdown link and image destinations.src/types.ts,src/html.ts,src/react.ts,src/octane.ts,src/utils.ts,tests/...preelements, and expands shared escaping for backticks.scripts/...,tests/...README.md,docs/...,reports/...,tests/bundle-size.test.ts,.changeset/...Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~30 minutes
Change: Feature · Severity of issue fixed: Medium
Merge Risk: ⚪ Minimal · up to
fe3e4The Markdown integration changes are covered across supported renderers and preserve the documented security and rendering contracts. No merge-blocking risk remains.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
#7,CodeBlockNode.metais forwarded to highlighter options and rendered as escapeddata-meta; the summary and regression tests …Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 28 functions across 15 files. (22 skipped: 22 unsupported.)
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share