← 返回
未分类

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 HTML, replicate or analyze wechat.bmpi.dev theme behavior, or require text theme and code-block highlighting to be independently switchable.
Render Markdown to polished HTML with WeChat-friendly typography and explicit theme layering. Use when users ask to convert Markdown articles to formatted HTML, replicate or analyze wechat.bmpi.dev theme behavior, or require text theme and code-block highlighting to be independently switchable.
yjkj999999
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 13
下载
💾 0
安装
1
版本
#latest

概述

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

  1. Inspect site-mechanism notes in references/wechat-bmpi-analysis.md when the request mentions wechat.bmpi.dev.
  2. Install dependencies in the skill folder:
npm install
  1. 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
  1. Validate that the output includes the four style blocks and that --text-theme and --code-theme can 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, default gold-sea)
  • --code-theme: wechat | atomOneDark | atomOneLight | monokai | github | vs2015 | xcode (optional, default wechat)
  • --font: serif | sans (optional, default serif)
  • --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 #nice and syntax highlighting under .hljs/pre code selectors 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:

  1. Flatten
  2. for leaf items. The MP editor drops the list marker (the 1. 2. 3. numbers, or bullets) when a
  3. contains a block-level child like
    , and also inserts an extra blank row per item from the section's vertical margins. Fix: for
  4. that does NOT contain a nested
      /
        , the renderer unwraps the inner section and merges its typographic styles directly onto the
      1. . Items with nested sub-lists keep the section wrapper (their sub-list layout depends on it).
      1. Zero whitespace at
          /
            boundaries and between sibling
          • s. The MP editor treats whitespace text nodes between
          • siblings (and at the start/end of a
              /
                ) 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:
                  → first
                1. ,
                2. → next
                3. , last
                (and the same for
                  ).

              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 + 1 for N real 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.

版本历史

共 1 个版本

  • v1.0.0 从ClawHub迁移发布 当前
    2026-06-07 12:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 931 📥 210,975
design-media

agnes-image-gen

user_15292d5a
使用 Agnes AI 的图片生成模型生成图片,支持文生图(agnes-image-2.1-flash)和图生图(agnes-image-2.0-flash)。支持自定义 API Key,用户可使用自己的 Agnes Key。优化重点:降低
★ 1 📥 235
content-creation

Marketing Skills

jchopard69
访问 23 个营销模块,提供转化率优化(CRO)、SEO、文案撰写、分析、发布、广告和社交媒体的清单、框架及可直接使用的交付物。
★ 145 📥 31,519