From 7786aed53ea5f0d88c08e840046c33483460cf01 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 27 Oct 2026 15:55:48 +0800 Subject: [PATCH] Update public-api.js via upload script - 2026-10-27 15:55:49 --- public-api.js | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/public-api.js b/public-api.js index c820378..06af502 100644 --- a/public-api.js +++ b/public-api.js @@ -228,12 +228,43 @@ function htmlSegments(h) { return out; } const tplHtmlOf = (t) => (t && String(t.html || '').trim() ? cleanTplHtml(t.html) : ''); +// 详情图片里的 HTML 片段(原样显示,网站上放在隔离的 iframe 里):detailHtml = [{ id, html, pos }],pos = 排在第几张图后面(0 = 最上面) +const tplDetailBlocks = (t) => arr(t && t.detailHtml).filter((b) => b && String(b.html || '').trim()); +function tplDetailSeq(t) { + const imgs = tplImagesOf(t), blocks = tplDetailBlocks(t); + const out = []; + for (let i = 0; i <= imgs.length; i++) { + for (const b of blocks) if (Math.min(Math.max(0, Math.round(+b.pos || 0)), imgs.length) === i) out.push({ html: String(b.html).replace(/\s*\[cite:[^\]]*\]/gi, '') }); + if (i < imgs.length) out.push({ img: imgs[i] }); + } + return out; +} +// 原样 HTML 的翻译:只翻译正文文字,