Preview checker: a `<title>` written over several lines keeps its line break and indentation
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 84/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- backend
Rechercherichtung
Beginne mit parseMetaTags() in src/lib/meta-fetcher.ts und finde die vorhandenen Tests zur Titelverarbeitung, einschließlich des Tests, der interne Leerzeichen in Meta-content erhält. Füge einen fehlschlagenden Test für mehrzeilige und wiederholte ASCII-Leerzeichen in Titeln hinzu und prüfe anschließend, dass sich das Verhalten von Meta-content nicht geändert hat. Als abgeschlossen gilt die Aufgabe, wenn der Titel dem Zusammenfassen von Leerzeichen durch den Browser entspricht und die aufgeführten Prüf-, Test- und Build-Befehle erfolgreich sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
parseMetaTags() in src/lib/meta-fetcher.ts only trims the ends of the <title> text (decodeEntities(titleMatch[1].trim())), so a title written over several lines keeps the line break and the indentation in the middle. Browsers strip and collapse that whitespace (document.title gives Cutting cold starts in half with Fluid Compute | Acme Blog), but the checker keeps it:
parseMetaTags(`<title>
Cutting cold starts in half with Fluid Compute
| Acme Blog
</title>`, 'https://example.com').title
// "Cutting cold starts in half with Fluid Compute\n | Acme Blog"
That 58-character title gets "Title is 72 chars (recommended: under 70)" from analyzeMeta(), and the Google Search preview (resolvePlatformPreviews() in src/lib/platform-specs.ts) cuts it at 60 characters in the middle of the whitespace, so | Acme Blog never shows.
What to do
- After decoding entities, collapse each run of ASCII whitespace (space, tab, newline, carriage return, form feed) in the title to one space and strip it from both ends, the way
document.titledoes. isn't ASCII whitespace, so it stays. - Leave meta
contentvalues as they are. They keep their inner whitespace on purpose (the "trims decoded meta content while preserving internal whitespace" test).
Acceptance criteria
- The title above comes out as
Cutting cold starts in half with Fluid Compute | Acme Blog, and tabs or double spaces inside a title collapse the same way - Meta
contentvalues and every existingparseMetaTagstest stay as they are - 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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 8
- Forks
- 4
- Ø Merge
- 8 Std. 44 Min.
- Gemergte PRs (30 T.)
- 159
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus codercops/ogcops
-
bug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
codercops/ogcops#394 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] “Copy Recommended Meta Tags” generates an unusable placeholder image URLEvtl. wieder frei @CreatorguyS hat das vor 7 Tagen übernommen, und es ist kein Pull Request offen. Offenbug enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
codercops/ogcops#378 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Add the Do and Don't tutorial template (`tutorial-do-dont`)Evtl. vergeben @Ravindar-Amogh-Gummadavelly hat das vor 7 Tagen übernommen. Offengood first issue templates
codercops/ogcops#355 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
codercops/ogcops#341 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codercops/ogcops
Ähnliche Issues
-
Billion-context documentation addendum: nudge is independent of window occupancy. | billion-context 文档补充:nudge 与窗口占用无关Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 86/100
ranxianglei/billion-context#5893 ·
Maintainer antworten meist innerhalb von 1 Tag
-
stringify escapes leading digits in pseudo-class arguments (:nth-child(1) becomes :nth-child(\31 ))Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement security severity:low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Battle-Cattle/BCUK-Bot-4#959 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Claude account rows no longer show the email (since #8055), so "Account 1, 2, 3" cannot be told apartEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenaccount-pool bug gui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
lidge-jun/opencodex#8286 · 2 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag