vomebook commited on
Commit
b49b892
·
1 Parent(s): afb04b0

Keep reviewed thread label out of composed Reader title namespace

Browse files
static/reader/formats/reader-html-format.mjs CHANGED
@@ -52,15 +52,15 @@ function tiebaPostSection(post, doc) {
52
 
53
  /** @param {DocumentFragment} root */
54
  function buildReviewedTiebaView(root) {
55
- const title = root.querySelector("h3.core_title_txt")?.textContent.trim();
56
  const doc = root.ownerDocument;
57
  const posts = [...root.querySelectorAll("#j_p_postlist > .j_l_post")].map(post => tiebaPostSection(post, doc));
58
- if (!title || posts.length !== 18 || !posts.every(post => post !== null)) return false;
59
  const article = doc.createElement("article");
60
  article.className = "reader-clean-web reader-tieba-view";
61
  const note = labeledElement(doc, "p", "此存档未收录 20 处原帖表情图片,已在对应位置标记。");
62
  note.className = "reader-tieba-note";
63
- article.append(labeledElement(doc, "h1", title), note, ...posts);
64
  if (article.querySelectorAll(".reader-tieba-reply").length !== 5 ||
65
  article.querySelectorAll("img[src]").length !== 29) return false;
66
  const gaps = article.querySelectorAll("img.BDE_Smiley:not([src])");
 
52
 
53
  /** @param {DocumentFragment} root */
54
  function buildReviewedTiebaView(root) {
55
+ const threadTitle = root.querySelector("h3.core_title_txt")?.textContent.trim();
56
  const doc = root.ownerDocument;
57
  const posts = [...root.querySelectorAll("#j_p_postlist > .j_l_post")].map(post => tiebaPostSection(post, doc));
58
+ if (!threadTitle || posts.length !== 18 || !posts.every(post => post !== null)) return false;
59
  const article = doc.createElement("article");
60
  article.className = "reader-clean-web reader-tieba-view";
61
  const note = labeledElement(doc, "p", "此存档未收录 20 处原帖表情图片,已在对应位置标记。");
62
  note.className = "reader-tieba-note";
63
+ article.append(labeledElement(doc, "h1", threadTitle), note, ...posts);
64
  if (article.querySelectorAll(".reader-tieba-reply").length !== 5 ||
65
  article.querySelectorAll("img[src]").length !== 29) return false;
66
  const gaps = article.querySelectorAll("img.BDE_Smiley:not([src])");