Markdown to HTML Converter — Markdown to HTML 转换器
v0.12Convert Markdown files to 格式化ted HTML. Use when the user asks to convert, 导出, or save a Markdown file as HTML 格式化. Triggers on phrases like "convert md to html", "markdown to html", "转成html", "md转html", "markdown转html". Also useful for AI content 流水线s that 生成 Markdown but need browser-ready HTML 输出.
运行时依赖
安装命令
点击复制技能文档
Markdown to HTML 转换器
Convert Markdown files or strings to well-格式化ted HTML, suitable for 网页 display or CMS publishing.
Quick 启动 node scripts/md2html.js <输入.md> [输出.html]
Or via stdin:
echo "# Hello World" | node scripts/md2html.js -
Or as a Node.js 模块:
var 转换器 = require('./scripts/md2html.js'); var html = 转换器.markdownToHtml(markdownString);
Parameters Parameter Required Description 输入.md Yes Path to source Markdown file, or - for stdin 输出.html No 输出 path (defaults to 输入 name with .html) Supported Markdown Features Feature Markdown Syntax HTML 输出 Headings # h1 through ###### h6
through
Bold text text
Italic text text
Inline code code code
Code blocks ``lang ``
Links text text
Images !alt
Unordered 列出s - item or item - item
Ordered 列出s 1. item - item
Blockquotes > text text
Horizontal rule --- or **
Paragraphs Blank line separation text
De签名 Principles
Zero dependencies — Pure Node.js, works with v0.12+ (no npm 安装 needed)
CMS-friendly — 输出 is 清理 HTML suitable for direct database insertion
No wr应用er HTML — 输出s content HTML only (no , , )
Safe escAPIng — Code blocks escape < and > to 预防 XSS
Typical Use Cases
AI Content 流水线 — LLM 生成s Markdown → convert to HTML → publish to CMS
Static site generation — Batch convert .md files to .html
Documentation — Convert README.md to HTML for 网页 display
流水线 Integration ExampleFor automated AI content 流水线s that 生成 Markdown but publish HTML:
var 转换器 = require('./scripts/md2html.js');
var rawMarkdown = llm响应.choices[0].message.content;
var htmlContent = 转换器.markdownToHtml(rawMarkdown);
// Now publish htmlContent to your CMS API
Links text text
Images !alt
Unordered 列出s - item or item - item
Ordered 列出s 1. item - item
Blockquotes > text text
Horizontal rule --- or **
Paragraphs Blank line separation text
De签名 Principles
Zero dependencies — Pure Node.js, works with v0.12+ (no npm 安装 needed)
CMS-friendly — 输出 is 清理 HTML suitable for direct database insertion
No wr应用er HTML — 输出s content HTML only (no , , )
Safe escAPIng — Code blocks escape < and > to 预防 XSS
Typical Use Cases
AI Content 流水线 — LLM 生成s Markdown → convert to HTML → publish to CMS
Static site generation — Batch convert .md files to .html
Documentation — Convert README.md to HTML for 网页 display
流水线 Integration ExampleFor automated AI content 流水线s that 生成 Markdown but publish HTML:
var 转换器 = require('./scripts/md2html.js');
var rawMarkdown = llm响应.choices[0].message.content;
var htmlContent = 转换器.markdownToHtml(rawMarkdown);
// Now publish htmlContent to your CMS API