mdx-sanitizer

Sanitize MDX content to prevent JSX parsing errors in Docusaurus builds.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/jcteague/wheelbase --skill mdx-sanitizer-jcteague
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mdx-sanitizer
Source: https://github.com/jcteague/wheelbase/tree/main/.agents/skills/mdx-sanitizer
Command: npx skills add https://github.com/jcteague/wheelbase --skill mdx-sanitizer-jcteague

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MDX/MDX-based content can fail to build when angle brackets, Liquid/Nunjucks templates, and TypeScript generics are present without proper escaping. This skill provides a structured approach to sanitize MDX before deployment.

Core Features & Use Cases

  • Three-layer defense: sync-time sanitization, pre-commit validation, and build-time validation to prevent MDX-related build failures.
  • Handles common problematic patterns like unescaped angle brackets, template syntax, and generics in docs to ensure safe rendering.
  • Useful for teams deploying MDX-heavy docs with Docusaurus or similar toolchains, ensuring warn-free builds and reliable rendering.

Quick Start

Run the sanitizer on your MDX content to fix angle brackets, template syntax, and TypeScript generics before building the site.

Frequently Asked Questions about mdx-sanitizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Docusaurus build fail with JSX parsing errors in MDX?

Docusaurus builds fail when MDX contains unescaped angle brackets, templating syntax, or TypeScript generics. Sanitizing the MDX content before deployment prevents these JSX parsing errors and ensures successful site builds.

How do I fix unescaped angle brackets and TypeScript generics in MDX?

To fix unescaped angle brackets and TypeScript generics in MDX, apply a sanitizer that escapes problematic syntax before rendering. This process adjusts the markdown content to ensure safe parsing and prevents build-time failures.

What is the best way to prevent MDX build failures in documentation workflows?

The best way to prevent MDX build failures is using a three-layer defense: sync-time sanitization, pre-commit validation, and build-time validation. This approach catches unescaped syntax and templating errors early in the documentation workflow.

Can I use a pre-commit hook to validate MDX content for Docusaurus?

Yes, you can validate MDX content for Docusaurus using a pre-commit hook. This checks for problematic patterns like unescaped angle brackets and template syntax before code is committed, ensuring warn-free builds and reliable rendering downstream.

Does mdx-sanitizer work with TypeScript and Docusaurus documentation?

Yes, mdx-sanitizer works with TypeScript and Docusaurus documentation workflows. It specifically targets problematic TypeScript generics and templating syntax within MDX files to unblock and ensure successful Docusaurus site builds.

What types of MDX syntax cause Docusaurus build errors?

MDX syntax that causes Docusaurus build errors includes unescaped angle brackets, Liquid and Nunjucks templating syntax, and TypeScript generics. Sanitizing these patterns ensures the JSX parser handles the content correctly during the build.