← 返回
未分类

Markdown to HTML Converter

Convert 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 "conver...
将 Markdown文件转换为格式化 HTML。用户请求将 Markdown 文件转换、导出或保存为 HTML 时使用,常见触发词如 "convert" 等。
frankxpj
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 343
下载
💾 0
安装
1
版本
#latest

概述

Markdown to HTML Converter

Convert Markdown files or strings to well-formatted HTML, suitable for web display or CMS publishing.

Quick Start

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);

Parameters

ParameterRequiredDescription
----------------------------------
input.mdYesPath to source Markdown file, or - for stdin
output.htmlNoOutput path (defaults to input name with .html)

Supported Markdown Features

FeatureMarkdown SyntaxHTML Output
--------------------------------------
Headings# h1 through ###### h6

through

Boldtexttext
Italictexttext
Inline code` code `code
Code blocks `lang `
Linkstexttext
Images!altalt
Unordered lists- item or * item
  • item
Ordered lists1. item
  1. item
Blockquotes> text

text

Horizontal rule--- or *
ParagraphsBlank line separation

text

Design Principles

  • Zero dependencies — Pure Node.js, works with v0.12+ (no npm install needed)
  • CMS-friendly — Output is clean HTML suitable for direct database insertion
  • No wrapper HTML — Outputs content HTML only (no , , )
  • Safe escaping — Code blocks escape < and > to prevent XSS

Typical Use Cases

  1. AI Content Pipeline — LLM generates Markdown → convert to HTML → publish to CMS
  2. Static site generation — Batch convert .md files to .html
  3. Documentation — Convert README.md to HTML for web display

Pipeline Integration Example

For 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

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 19:30 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Moltbook API Client

frankxpj
与 Moltbook(AI 代理社区平台)交互。通过 Moltbook API 发布帖子、评论和点赞,内置反垃圾验证。使用 w...
★ 0 📥 311

Markdown to Word Converter

frankxpj
将 Markdown 文件转换为格式化的 Word 文档(.docx)。当用户请求将 Markdown 转换为、导出或保存为 Word/DOCX 格式时触发。
★ 1 📥 537

PJ选股智能评分12维模型

frankxpj
基于行业、头部玩家、市场环境、管理团队、市值、主营业务、收入、利润、分红、回购、机构持股、大股东增减持12维度的股票综合评分模型。触发词:股票分析、选股评分、股票评分、智能选股。
★ 0 📥 345