TinyMCE Rich Text to Semantic HTML Conversion Pipeline
Built an automated conversion pipeline that normalizes TinyMCE-editor output into clean semantic HTML for the research blog, stripping presentation attributes and enforcing heading hierarchy.
Pipeline Steps
- TinyMCE output validated against DOMPurify ruleset to prevent XSS in user-submitted content.
- Table-of-contents extracted from <h2>/<h3> elements for sidebar navigation on long-form posts.
- Inline style attributes removed; equivalent class-based styling applied via CSS custom properties.
- Code blocks wrapped in <pre><code> with language detection via shebang or metadata tags.