Preview checker: named entities like `’` and `—` show up as raw text
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start with decodeEntities() and NAMED_ENTITIES in src/lib/meta-fetcher.ts, then review the existing parseMetaTags tests. Add the HTML 4 entity table in src/lib/html-entities.ts and update the entity name matching while preserving exact case and safe lookup behavior. Add a regression test for named entities with digits, then run npm run check, npm run test, and npm run build; done when the acceptance criteria pass.
索引モデルが issue の本文から書いたものです。
説明
decodeEntities() in src/lib/meta-fetcher.ts only knows the ten names in NAMED_ENTITIES (line 190: amp, lt, gt, quot, apos, nbsp and the uppercase AMP, LT, GT, QUOT), so any other named entity reaches the preview checker as raw text. Typographic ones like ’, —, … and “ are common in titles and descriptions, and browsers show them as the characters (document.title gives Don’t ship on Fridays — notes from 200 releases | Acme Blog), but the checker keeps them:
parseMetaTags('<title>Don’t ship on Fridays — notes from 200 releases | Acme Blog</title>', 'https://example.com').title
// "Don’t ship on Fridays — notes from 200 releases | Acme Blog"
That 59-character title gets "Title is 71 chars (recommended: under 70)" from analyzeMeta(), every platform card shows the ’ and —, and the Google Search preview (resolvePlatformPreviews() in src/lib/platform-specs.ts) cuts it at 60 characters before | Acme Blog. Accented letters (é, É) and symbols (©, ™, €) stay raw the same way, and Smart Autofill (src/pages/api/ai/autofill.ts:63) hands the raw text to the model.
The regex has a second catch: it only matches names made of letters ([a-z]+), so ½, ² and the other names with digits can't decode even once they're in the table.
What to do
- Add the rest of the 252 named entities from HTML 4 (the Latin-1, symbol and special sets) to the table. That's where the typographic and accented-letter ones live, and it keeps the table to a few hundred lines instead of HTML5's full list of over 2,000. Put it in its own file, like
src/lib/html-entities.ts, someta-fetcher.tsstays readable, and keepaposand the four uppercase names that are there now. - Take the characters from the current list (https://html.spec.whatwg.org/entities.json), since a few changed after HTML 4 (
⟨and⟩are U+27E8 and U+27E9 now). - Names are case-sensitive, so keep the exact lookup (
ÉisÉ,éisé) and theObject.hasOwncheck from #391. - Let the regex match names with digits, like
[a-z][a-z0-9]*. Numeric entities already work, so leave that branch as it is.
Acceptance criteria
- The title above comes out as
Don’t ship on Fridays — notes from 200 releases | Acme Blog, and every HTML 4 named entity decodes in titles and attribute values, including½and² - Unknown names, wrong-case names like
&Amp;and&NBSP;, and prototype names like&constructor;stay as they are, and every existingparseMetaTagstest still passes - A test that fails on the current code
-
npm run check,npm run testandnpm run buildpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #NUM in the description.
- 主要言語
- TypeScript
- スター
- 8
- フォーク
- 4
- 平均マージ
- 8時間 44分
- マージ済み PR(30日)
- 159
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/ogcops のほかの issue
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
codercops/ogcops#394 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Preview checker: a `<title>` written over several lines keeps its line break and indentation対応中かも @bhushan4work が 1 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
codercops/ogcops#393 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] “Copy Recommended Meta Tags” generates an unusable placeholder image URL対応中かも @CreatorguyS が 7 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
codercops/ogcops#378 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Add the Do and Don't tutorial template (`tutorial-do-dont`)対応中かも @Ravindar-Amogh-Gummadavelly が 7 日前に担当しました。 オープンgood first issue templates
codercops/ogcops#355 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
codercops/ogcops#341 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
codercops/ogcops の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
ranxianglei/billion-context#5893 ·
メンテナーはふだん 1 日以内に返信
-
stringify escapes leading digits in pseudo-class arguments (:nth-child(1) becomes :nth-child(\31 ))オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
enhancement security severity:low
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Battle-Cattle/BCUK-Bot-4#959 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Claude account rows no longer show the email (since #8055), so "Account 1, 2, 3" cannot be told apart対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンaccount-pool bug gui
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
lidge-jun/opencodex#8286 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信