Wechat Markdown Html Render
/install wechat-markdown-html-render
Wechat Markdown Html Render
Overview
Render Markdown files into standalone HTML with separate style layers: basic-theme, text-theme, code-theme, and font-theme.
Use scripts/render-markdown-html.js to generate deterministic output and keep code-block visuals independent from text theme.
Workflow
- Inspect site-mechanism notes in
references/wechat-bmpi-analysis.mdwhen the request mentionswechat.bmpi.dev. - Install dependencies in the skill folder:
npm install
- Render Markdown, you can pick a text-theme and code-theme and font-theme according to article contents:
node scripts/render-markdown-html.js \
--input /path/to/input.md \
--output /path/to/output.html \
--text-theme geek-black \
--code-theme wechat \
--font serif
- Validate that the output includes the four style blocks and that
--text-themeand--code-themecan be changed independently.
Script Interface
--input: Markdown source file path (required)--output: HTML output file path (required)--text-theme:normal | orange-heart | geek-black | minimal-dark | gold-sea(optional, defaultgold-sea)--code-theme:wechat | atomOneDark | atomOneLight | monokai | github | vs2015 | xcode(optional, defaultwechat)--font:serif | sans(optional, defaultserif)--title: Custom HTML title (optional)--custom-css-file: CSS file used only when--text-theme custom(optional)
Notes
- The script intentionally scopes markdown typography under
#niceand syntax highlighting under.hljs/pre codeselectors so code theme remains independent. - The output is standalone HTML and can be copied into downstream editors.
WeChat MP editor list normalization (built into the renderer)
The script applies two post-processing rules specifically to survive the WeChat 公众号 editor's non-standard HTML ingester. These are NOT optional — they're enabled for every render — but worth knowing when reviewing output or extending the script:
-
Flatten
\x3Cli>\x3Csection>…\x3C/section>\x3C/li>for leaf items. The MP editor drops the list marker (the1. 2. 3.numbers, or•bullets) when a\x3Cli>contains a block-level child like\x3Csection>, and also inserts an extra blank row per item from the section's vertical margins. Fix: for\x3Cli>that does NOT contain a nested\x3Cul>/\x3Col>, the renderer unwraps the inner section and merges its typographic styles directly onto the\x3Cli>. Items with nested sub-lists keep the section wrapper (their sub-list layout depends on it). -
Zero whitespace at
\x3Col>/\x3Cul>boundaries and between sibling\x3Cli>s. The MP editor treats whitespace text nodes between\x3Cli>siblings (and at the start/end of a\x3Cul>/\x3Col>) as additional EMPTY list items, producing numbered/bulleted blank rows interleaved with the real ones. Newline-only stripping is NOT enough — spaces and tabs leak through and still trigger the bug. The renderer collapses all whitespace at those three positions:\x3Col>→ first\x3Cli>,\x3C/li>→ next\x3Cli>, last\x3C/li>→\x3C/ol>(and the same for\x3Cul>).
Symptoms in the MP editor preview when either rule fails:
- Rule 1 broken → no
1. 2. 3.markers, items show as plain paragraphs separated by blank rows. - Rule 2 broken →
1. (blank) / 2. real / 3. (blank) / 4. real / …— count of visual rows ≈2N + 1forNreal items.
If you copy text out of the MP editor and the markers are missing, that's a clipboard artifact (markers are CSS ::marker pseudo-elements, not text nodes) — verify in the editor's visual preview, not the copied text.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install wechat-markdown-html-render - After installation, invoke the skill by name or use
/wechat-markdown-html-render - Provide required inputs per the skill's parameter spec and get structured output
What is Wechat Markdown Html Render?
Render Markdown to polished HTML with WeChat-friendly typography and explicit theme layering. Use when users ask to convert Markdown articles to formatted HT... It is an AI Agent Skill for Claude Code / OpenClaw, with 44 downloads so far.
How do I install Wechat Markdown Html Render?
Run "/install wechat-markdown-html-render" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Wechat Markdown Html Render free?
Yes, Wechat Markdown Html Render is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Wechat Markdown Html Render support?
Wechat Markdown Html Render is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Wechat Markdown Html Render?
It is built and maintained by Jacky Shen (@mebusw); the current version is v1.0.0.