Install
openclaw skills install md-2-htmlConvert Markdown files to formatted HTML. Use when the user asks to convert, export, or save a Markdown file as HTML format. Triggers on phrases like "convert md to html", "markdown to html", "转成html", "md转html", "markdown转html". Also useful for AI content pipelines that generate Markdown but need browser-ready HTML output.
openclaw skills install md-2-htmlConvert Markdown files or strings to well-formatted HTML, suitable for web display or CMS publishing.
node scripts/md2html.js <input.md> [output.html]
Or via stdin:
echo "# Hello World" | node scripts/md2html.js -
Or as a Node.js module:
var converter = require('./scripts/md2html.js');
var html = converter.markdownToHtml(markdownString);
| Parameter | Required | Description |
|---|---|---|
input.md | Yes | Path to source Markdown file, or - for stdin |
output.html | No | Output path (defaults to input name with .html) |
| Feature | Markdown Syntax | HTML Output |
|---|---|---|
| Headings | # h1 through ###### h6 | <h1> through <h6> |
| Bold | **text** | <strong>text</strong> |
| Italic | *text* | <em>text</em> |
| Inline code | `code` | <code>code</code> |
| Code blocks | ```lang ``` | <pre><code class="language-lang"> |
| Links | [text](url) | <a href="url" target="_blank">text</a> |
| Images |  | <img src="url" alt="alt"> |
| Unordered lists | - item or * item | <ul><li>item</li></ul> |
| Ordered lists | 1. item | <ol><li>item</li></ol> |
| Blockquotes | > text | <blockquote><p>text</p></blockquote> |
| Horizontal rule | --- or *** | <hr> |
| Paragraphs | Blank line separation | <p>text</p> |
<html>, <head>, <body>)< and > to prevent XSS.md files to .htmlFor automated AI content pipelines that generate Markdown but publish HTML:
var converter = require('./scripts/md2html.js');
var rawMarkdown = llmResponse.choices[0].message.content;
var htmlContent = converter.markdownToHtml(rawMarkdown);
// Now publish htmlContent to your CMS API