Formatting for WeChat Official Accounts: Converting Markdown to Paste-Ready WeChat HTML

Introduction

The WeChat Official Account backend imposes strict limitations on HTML and CSS: external stylesheets, scripts, and most layout properties are unsupported, and pasting regular webpage snippets often results in misaligned formatting. Many people write articles in Markdown, then manually adjust styles or apply templates, with summaries and code blocks requiring separate handling.

This article introduces the Agent Skill “WeChat Official Account Formatting” on SkillHub: it converts Markdown into WeChat-compatible HTML with inline styles within conversations, generates summaries and end-of-article interaction prompts, reducing repetitive formatting work.

What Is This

“WeChat Official Account Formatting” (slug: wechat-formatting, current version v1.0.0) is a community-published Agent Skill that follows the standard SKILL.md format. The publisher is displayed as STAND-ALONE, with the identifier @indiv-stand-alone/wechat-formatting on SkillHub, corresponding to the publisher handle user_4cc07111.

The Skill is positioned to convert Markdown into HTML acceptable by the WeChat Official Account backend, automatically generate summaries, inject inline styles, and handle code blocks, tip blocks, warning blocks, and WeChat’s official music component.

It is categorized under content-creation (subcategory “Article Writing”) on SkillHub. As of verification, public statistics show approximately 1,820 downloads and 1 star; no API Key is required.

Note: The URL https://api.skillhub.cn/user_4cc07111/wechat-formatting in the task clues cannot open a detail page in a browser; the accessible Skill page is https://skillhub.cn/skills/indiv-stand-alone/wechat-formatting.

Core Features

The following capabilities are from the SKILL.md in the Skill package and the SkillHub API summary, all verified.

  1. Markdown → WeChat HTML: Parses headings, paragraphs, blockquotes, bold/italic, inline code, code blocks, horizontal rules, etc., and applies default inline styles.
  2. Automatic Summary Generation: Approximately 35–120 characters, structured as “Emotional Hook + Core Content + Value Promise”; output is wrapped in a WECHAT SUMMARY comment block.
  3. Styles & Compliance: Forbids <style>, <script>, class, id, and blacklisted CSS like flex/grid; all styles must be inline; code highlighting uses <span> with color.
  4. Extended Blocks: Supports ::: tip, ::: warning containers, and ::: music WeChat official music component (mpvoice / mpmusic, not <audio>).
  5. Images & Sanitization: Regular images only accept the mmbiz.qpic.cn domain; non-compliant images are converted to tip paragraphs; tag and attribute sanitization is performed before output.
  6. End-of-Article Interaction: Generates lightweight interactive questions based on article type (tutorial, opinion, narrative, etc.), appended to the end of the HTML.
  7. Fixed Output Format: Outputs only the summary block and HTML block, without explanatory text.

Installation & Activation

Method 1: SkillHub CLI

First, ensure skillhub is installed (installation instructions at https://skillhub.cn/install/skillhub.md). During installation, use --dir to point to the current Agent’s skills directory; otherwise, the default ./skills/ location may not be recognized.

skillhub install wechat-formatting --namespace indiv-stand-alone --dir ~/.cursor/skills/

Common skills directories (from SkillHub installation documentation):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ in the project

After installation, restart or refresh the Agent according to your client’s requirements to load the Skill.

Method 2: Let AI Install via Official Prompt

You can copy the installation prompt from the SkillHub skill page, which roughly says:

Please install `@indiv-stand-alone/wechat-formatting` according to https://skillhub.cn/install/skillhub.md.

Typical Usage

After activating the Skill, simply describe in natural language that you want to convert Markdown to WeChat Official Account HTML. The example from the official SKILL.md is as follows.

User input:

Help me convert the following Markdown to WeChat Official Account HTML:

# Title

Body content...

The Agent should only output the following structure (with the actual summary and HTML in between), without explaining the conversion process:

<!-- START: WECHAT SUMMARY -->
[Automatically generated article summary here]
<!-- END: WECHAT SUMMARY -->

<!-- START: WECHAT HTML -->
[Converted HTML code here]
<!-- END: WECHAT HTML -->

Copy the content within the WECHAT HTML block to the WeChat Official Account backend editor; the summary block is used for mass-send summaries or custom share text.

For custom syntax (tip / warning / music) writing, see references/custom-syntax.md in the Skill package; default styles and sanitization rules are in references/style-rules.md and references/sanitize-rules.md in the same directory.

Use Cases & Considerations

Who It’s For

  • Creators or operators who write long WeChat Official Account articles in Markdown and want paste-ready HTML in one step.
  • Technical or tutorial articles that need to retain code blocks, tip/warning boxes, or WeChat music components in the body.
  • Formatting within environments supporting Skills like Cursor, Claude Code, Codex, rather than running separate local conversion scripts.

Limitations & Notes

  • External or non-mmbiz.qpic.cn images will not output <img> directly; you must upload them to the WeChat material library first and then replace the address.
  • Lists and tables will be prioritized using paragraph or card-style structures to avoid complex table distortion in the backend.
  • The Skill constrains Agent behavior but does not guarantee complete synchronization with future WeChat backend rule changes; preview in the backend before publishing is still recommended.
  • The SkillHub page rating of 99643 in the clues was not verified in the public API fields; this number is not included in this article.

Conclusion

“WeChat Official Account Formatting” incorporates common WeChat HTML whitelists, inline styles, and output formats into a Skill, suitable for directly obtaining paste-ready body text and summaries from Markdown in Agent conversations. For installation and details, see SkillHub:

  • Skill page: https://skillhub.cn/skills/indiv-stand-alone/wechat-formatting
  • API path from clues: https://api.skillhub.cn/user_4cc07111/wechat-formatting
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye