mdx-sanitizer

Sanitize MDX content to prevent Docusaurus build failures.

181|30|Updated Nov 16, 2025
One-click install
npx skills add https://github.com/curiositech/some_claude_skills --skill mdx-sanitizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mdx-sanitizer
Source: https://github.com/curiositech/some_claude_skills/tree/main/.claude/skills/mdx-sanitizer
Command: npx skills add https://github.com/curiositech/some_claude_skills --skill mdx-sanitizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill resolves common build failures in Docusaurus projects caused by unescaped characters and syntax conflicts within MDX files, ensuring smooth website deployments.

Core Features & Use Cases

  • Automated Sanitization: Fixes issues with angle brackets (<, >), Liquid/Nunjucks templates ({{ }}), TypeScript generics (Promise<T>), and inline code backticks.
  • Build Integration: Works seamlessly with pre-commit hooks and build processes to prevent errors before they occur.
  • Use Case: When your Docusaurus site fails to build due to MDX parsing errors related to unescaped angle brackets in technical documentation, this skill provides an automated fix.

Quick Start

Run the command npm run sanitize:mdx -- --fix within your website directory to automatically correct MDX issues.

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 when I use unescaped angle brackets in MDX?

Your Docusaurus build fails because unescaped angle brackets in MDX content are parsed as JSX tags rather than literal text. Sanitizing MDX content automatically escapes these characters to prevent build failures.

How do I fix MDX build errors caused by Liquid and Nunjucks syntax automatically?

You can fix MDX build errors by running the sanitize command within your website directory, which automatically corrects Liquid and Nunjucks template syntax conflicts in your Docusaurus project.

Can I integrate MDX sanitization into pre-commit hooks for my documentation build process?

Yes, you can integrate MDX sanitization into pre-commit hooks and build processes. This works seamlessly to prevent unescaped character errors before they occur during automated website deployments.

What is the best way to handle TypeScript generics like Promise<T> in MDX files?

The best way to handle TypeScript generics in MDX files is to sanitize the content. This Skill automatically fixes syntax conflicts caused by TypeScript generics to ensure smooth Docusaurus builds.

Does mdx-sanitizer fix inline code edge cases involving backticks in Docusaurus?

Yes, mdx-sanitizer fixes inline code edge cases involving backticks. It sanitizes MDX content to address these specific parsing conflicts and prevent build failures in Docusaurus projects.