qizong0079 downloadsCopy Markdown notes as WeChat-ready rich text, with live preview in an editor split or new tab.
Shuai WeChat Formatter is an Obsidian plugin for writers who publish through WeChat Official Accounts. Open a Markdown note, click the ribbon icon, and copy clean rich text with inline styles that can be pasted directly into the WeChat editor.
All formatting happens locally. The plugin does not upload notes, send network requests, collect analytics, or save copies of article content.
text/html and text/plain.| Type | Support |
|---|---|
| H1-H6 headings | Yes |
| Paragraphs and line breaks | Yes |
| Bold and italic text | Yes |
| Ordered and unordered lists | Yes |
| Blockquotes | Yes |
| Inline code and code blocks | Yes |
| Links | Yes, converted to references |
| Standard remote images | Yes |
| Tables and horizontal rules | Yes |
Obsidian ![[local image]] embeds |
Not yet |
After the plugin is accepted into the Obsidian Community directory, install it from Settings → Community plugins → Browse.
For manual installation, download main.js, manifest.json, and styles.css from the latest GitHub release and place them in:
<your-vault>/.obsidian/plugins/shuai-wechat-formatter/
Restart Obsidian, open Settings → Community plugins, and enable Shuai WeChat Formatter.
Node.js 18 or later is required.
git clone [email protected]:qizong007/shuai-ob-wx-offi-plugin.git
cd shuai-ob-wx-offi-plugin
npm install
npm run build
Use the 复制公众号格式 button at the top of the preview to copy the latest version again.
Open Settings → Shuai WeChat Formatter and enter Markdown footer content. For example:
### Join the community
Find more Obsidian and AI writing resources at <https://example.com>.
When enabled, the plugin inserts a visible horizontal rule before the footer. The floating controls in the lower-left corner of the preview can temporarily enable or disable the footer for both preview and copy output.
Choose how the preview opens in the plugin settings:
The floating preview panel provides two controls:
1.2 to 2.5.0 to 48px.Preview changes are temporary and affect the next copied result. Default values can be saved in plugin settings. The defaults are a line height of 1.8 and page margins of 16px.
WeChat may not preserve ordinary external links. The plugin replaces each Markdown link with a numbered reference and collects the source URLs at the very end of the article.
Read the [Obsidian website](https://obsidian.md).
The output is structured like this:
Read the Obsidian website[1].
References
[1] Obsidian website
https://obsidian.md
When footer content is enabled, the final order is article content, footer content, and then link references. Duplicate URLs share one reference number.
The Obsidian command palette includes:
The plugin parses the current Markdown note and generates HTML with inline styles. Inline styles are used because the WeChat editor usually removes external stylesheets. Before copying, the plugin also removes effects that are poorly supported by WeChat, including shadows, filters, transitions, and rounded corners.
Generated HTML is sanitized before it is inserted into the preview or clipboard fallback element. Link protocols are checked, and raw HTML from the note is escaped.
npm install
npm test
npm run build
npm test runs formatter unit tests.npm run build type-checks the TypeScript source and generates main.js.npm run dev watches source files and rebuilds during development.Project structure:
shuai-ob-wx-offi-plugin/
├── assets/
│ ├── plugin-icon.svg
│ └── readme/hero.svg
├── src/
│ ├── formatter.ts
│ ├── main.ts
│ └── settings.ts
├── tests/
│ └── formatter.test.ts
├── manifest.json
├── versions.json
├── styles.css
└── package.json
![[local image]] embeds are not converted into WeChat image assets.The plugin does not send network requests, collect user data, or retain article copies. Note content stays inside the current Obsidian window and is written to the system clipboard only when the user requests a copy.
Issues and pull requests are welcome. Before submitting a change, run:
npm test
npm run build
For changes related to WeChat styling compatibility, include both the Obsidian preview result and the result pasted into the WeChat editor.