con un clic
wenyan-xhs-debug
文言排版器小红书分页功能的高度测量与渲染不一致问题调试记录
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
文言排版器小红书分页功能的高度测量与渲染不一致问题调试记录
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
高德地图综合服务,支持POI搜索、路径规划、旅游规划、周边搜索和热力图数据可视化
Knowledge comic creator supporting multiple art styles and tones. Creates original educational comics with detailed panel layouts and sequential image generation. Use when user asks to create "知识漫画", "教育漫画", "biography comic", "tutorial comic", or "Logicomix-style comic".
Generate professional infographics with 21 layout types and 21 visual styles. Analyzes content, recommends layout×style combinations, and generates publication-ready infographics. Use when user asks to create "infographic", "visual summary", "信息图", "可视化", or "高密度信息大图".
Darwin Skill (达尔文.skill): autonomous skill optimizer inspired by Karpathy's autoresearch. Evaluates SKILL.md files using an 8-dimension rubric (structure + effectiveness), runs hill-climbing with git version control, validates improvements through test prompts, and generates visual result cards. Use when user mentions "优化skill", "skill评分", "自动优化", "auto optimize", "skill质量检查", "达尔文", "darwin", "帮我改改skill", "skill怎么样", "提升skill质量", "skill review", "skill打分".
从 DESIGN.md 生成预览图并截图的工作流 - 解决 Playwright 浏览器路径问题和 YAML 解析
Cron jobs auto-deliver final responses to configured targets — send_message to the same target gets deduplicated and skipped. Print report content directly as final response instead.
| name | wenyan-xhs-debug |
| title | 文言排版器小红书分页调试记录 |
| description | 文言排版器小红书分页功能的高度测量与渲染不一致问题调试记录 |
| tags | ["wenyan-editor","xhs","pagination","debug"] |
测量高度与实际渲染高度不一致
sizeScale = pageWidth / 440 // 1080/440 = 2.45
measureFontSize = 16 * sizeScale // 39px
renderScale = renderWidth / pageWidth // 270/1080 = 0.25
// 分页测量
blockHeight = measuredHeight / renderScale
// 渲染帧高度
frameHeight = content.offsetHeight * renderScale * 1.1
contentEl.offsetHeight(内容实际高度),导致每页高度不同getMaxXhsPageHeight() 函数:预先测量所有页面的实际高度,返回最大值// 获取所有页面中的最大高度(用于统一下载尺寸)
async function getMaxXhsPageHeight() {
const dims = getXhsDimensions();
const scroll = document.getElementById('preview-scroll');
const cards = scroll.querySelectorAll('.xhs-page-card');
let maxHeight = 0;
for (const card of cards) {
// 临时设置样式,获取实际高度
contentEl.style.transform = 'none';
contentEl.style.width = dims.width + 'px';
contentEl.style.overflow = 'visible';
await new Promise(r => setTimeout(r, 50));
maxHeight = Math.max(maxHeight, contentEl.offsetHeight);
// 恢复样式...
}
return maxHeight;
}
// downloadXhsPage 和 downloadAllXhsPages 都调用此函数获取统一高度