cbmarkdown

Convert Markdown strings to sanitized HTML in ColdBox applications.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill cbmarkdown
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cbmarkdown
Source: https://github.com/ColdBox/skills/tree/main/modules/cbmarkdown
Command: npx skills add https://github.com/ColdBox/skills --skill cbmarkdown

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Convert Markdown content into rendered HTML for ColdBox and BoxLang applications while preventing unsafe output and reducing repetitive rendering overhead. It addresses the gap between authoring text in Markdown and safely presenting rich HTML in views, APIs, and stored excerpts.

Core Features & Use Cases

  • Injection of the Processor service to convert Markdown strings to HTML inside services, handlers, and views.
  • Support for common Markdown features such as GitHub-Flavored Markdown tables, fenced code blocks, links, images, and blockquotes suitable for blogs, documentation, and comments.
  • Safety guidance and patterns for sanitizing user-submitted Markdown by combining conversion with cbantisamy to mitigate XSS risks.
  • Performance pattern recommendations such as caching rendered HTML for large documents and encoding metadata fields separately from body content.

Quick Start

Convert a Markdown string into sanitized HTML by injecting Processor@cbmarkdown, calling its toHTML method on the content, and then sanitizing the result with cbantisamy for any user-submitted input.

Frequently Asked Questions about cbmarkdown

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

FAQPage Schema
How do I convert markdown to HTML in a ColdBox application?

You can convert markdown to HTML in a ColdBox application by injecting the Processor@cbmarkdown service into your handler or service and calling its toHTML method on the markdown string. This renders GitHub-Flavored Markdown features like tables and fenced code blocks for views or APIs.

What is the best way to sanitize user-submitted markdown before rendering it as HTML?

The best way to sanitize user-submitted markdown is to convert it to HTML using cbmarkdown and then run the output through cbantisamy. This prevents XSS risks by cleaning the rendered HTML before displaying it to users.

Can I cache rendered markdown to HTML output to avoid repetitive processing?

Yes, you can cache rendered markdown to HTML output to reduce repetitive processing overhead. Caching the converted HTML is recommended for large documents and frequently accessed content like blog posts or documentation pages.

Does cbmarkdown support GitHub-Flavored Markdown tables and fenced code blocks?

Yes, cbmarkdown supports GitHub-Flavored Markdown features including tables, fenced code blocks, links, images, and blockquotes. This makes it suitable for rendering rich content like blogs, documentation, and comments.

Why do I need to sanitize markdown to HTML conversion output for APIs?

You need to sanitize markdown to HTML conversion output to mitigate XSS risks when users submit content. Even though markdown is converted to HTML, sanitizing with cbantisamy ensures no unsafe scripts or tags are rendered in views or API responses.

When should I separate metadata fields from body content during markdown to HTML conversion?

You should separate metadata fields from body content during markdown to HTML conversion when storing excerpts or structured data. Encoding metadata separately prevents rendering issues and allows the HTML body to be processed and cached independently.