CustomMarkdownEmitter
Summary
Custom markdown emitter that extends the base MarkdownEmitter to provide Mintlify-specific formatting and cross-reference resolution. This emitter converts TSDoc tables into Mintlify components (ParamField, ResponseField, TypeTree) for better documentation UX. It also handles API reference resolution with caching for performance. ## Architecture The emission process follows this flow: 1. TSDoc nodes are traversed recursively viawriteNode() 2. Tables are detected and classified by their header content 3. Property tables → TypeTree components with nested object support 4. Method/Constructor tables → ResponseField components 5. Other tables → HTML table fallback ## Security Considerations All user content is sanitized through SecurityUtils before being embedded in JSX/MDX: - sanitizeJsxAttribute() - For JSX attribute values (prevents quote escape attacks) - sanitizeJsonForJsx() - For JSON data embedded in JSX props - getEscapedText() - For markdown content (prevents markdown injection) Note: Content injection (XSS, template injection) is NOT a threat because users generate documentation from their own code for their own sites. Security focus is on command injection and path traversal (see CLAUDE.md). ## Caching Strategy API reference resolution is cached via ApiResolutionCache (LRU cache) to avoid repeated expensive lookups during documentation generation. Cache is ephemeral (per-run) and does not persist across builds.

