Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Data tables are removed as "unlikely candidates" when a class name contains "header" (e.g. Wikipedia's plainrowheaders)

オープン 初心者向け
#1,036 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

@axchadxs がすでに取り組んでいます。

2026年10月26日 から。

  • #1038 @axchadxs による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
web-dev

調査の方向性

_grabArticle の可能性が低い候補のチェックと、候補の削除およびテーブルに関する既存のテストから始めてください。提示された例で問題を再現し、header クラスとデータテーブルのマーカーを持つテーブルが保持される一方で、レイアウトテーブルには引き続き既存の条件付きクリーンアップが適用されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

Summary

A data table whose class contains header is removed whole by the unlikely-candidate pass in _grabArticle, because REGEXPS.unlikelyCandidates matches header anywhere in the class string. Wikipedia uses class="wikitable sortable plainrowheaders" on many award, filmography and discography tables, so those tables disappear from the output.

Elements inside a table are already exempt (!this._hasAncestorTag(node, "table")), but the <table> element itself is not.

Steps to reproduce

Readability 0.6.0 with jsdom 26.1.0 (the same check exists on main at ab4027a8):

import { Readability } from "@mozilla/readability";
import { JSDOM } from "jsdom";

const para = (n) => Array.from({ length: n }, (_, i) =>
  `<p>Paragraph ${i} of the article, long enough to be scored as content, with commas, clauses, and ordinary prose like a real page.</p>`).join("\n");
const table = (cls) => `<table class="${cls}"><caption>Awards</caption>
<tr><th>Award</th><th>Result</th></tr>
<tr><th scope="row">Academy Awards</th><td>Nominated</td></tr>
<tr><th scope="row">Annie Awards</th><td>Won</td></tr></table>`;
const run = (body) => new Readability(
  new JSDOM(`<!doctype html><html><body><article>${body}</article></body></html>`).window.document
).parse().content;

for (const cls of ["wikitable", "wikitable plainrowheaders"]) {
  console.log(cls, "→ table kept:", run(para(5) + table(cls) + para(2)).includes("Annie Awards"));
}

Output:

wikitable → table kept: true
wikitable plainrowheaders → table kept: false

With debug: true the log shows Removing unlikely candidate - wikitable sortable plainrowheaders ….

Real page: https://en.wikipedia.org/wiki/The_Wild_Robot_(film). The "Accolades" table (118 rows) is missing from the output.

Expected

A data table (one with a caption or <th> cells) is kept. In a table, "header" usually refers to the table's own header cells, not to the page header.

Possible fix

Exempt <table> elements from the unlikely-candidate check in the same way their descendants already are, or at least tables that _markDataTables would treat as data tables. Layout tables would still go through _cleanConditionally.

Related: #775 (also Wikipedia tables, different symptom).

主要言語
JavaScript
スター
11.5k
フォーク
741
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mozilla/readability のほかの issue

mozilla/readability の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。