Repository navigation
公众号图文:同稿预览与交付包 - #3
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b362c5124f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const summary = entries.get("digest"); | ||
| const cover = entries.get("cover"); | ||
| if (!title || !summary || !cover) throw new Error("公众号稿件需要 title、digest 和 cover"); | ||
| if (Buffer.byteLength(title, "utf8") > 64) throw new Error("公众号标题超过 64 字节"); |
There was a problem hiding this comment.
Count title width instead of UTF-8 bytes
For Chinese titles, Buffer.byteLength(..., "utf8") counts each Han character as three bytes, so any all-Chinese title longer than 21 characters is rejected. WeChat's title allowance is based on characters/display-width rather than raw UTF-8 storage bytes, so otherwise valid 22–32-character titles cannot be previewed or exported; validate using the platform's character-width rule instead.
Useful? React with 👍 / 👎.
Facet 生成手机正文与订阅卡片的本地预览,并导出同一份正文 HTML、素材和校验清单。现有 PDF/长图模板不变。该功能不接入微信账号、不入草稿箱、不发布文章。
已验证:源码与编译后 CLI、正文逐字节一致、素材校验、缺图和防覆盖;360px / 390px 本地 Chrome 卡片、正文与三张图片显示正常,无横向溢出。微信真机验收属于公众号业务项目,尚未执行。