Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

frontmatter: an unterminated quoted scalar is accepted silently and keeps its opening quote

Aperta Adatta ai principianti
#138 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
content, testing

Direzione di ricerca

Leggi prima site/lib/frontmatter.mjs e lib.test.mjs; esamina come parseScalar gestisce i valori tra virgolette e come vengono segnalati gli errori di frontmatter con i numeri di riga. Aggiungi casi che rifiutino gli scalari tra virgolette e gli elementi di elenco non terminati, quindi esegui npm run validate e conferma che il fixture segnali la riga della virgoletta non chiusa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug priority: low

Why it matters

name: "Foo (a missing closing quote, an easy slip when a name contains an apostrophe) parses as the string "Foo and flows into pages, data.json, the CSV and the feed with a stray quote. checkTitleMatchesName happens to catch it for name, but publisher, attribution_string, grid_dimensions, ue_versions and list items have no backstop.

Evidence (at 69387df)

site/lib/frontmatter.mjs:69-82 parseScalar only unquotes when the value both starts and ends with the same quote; otherwise it returns the raw text. Verified: parsing a frontmatter block containing name: "Foo yields meta.name === '"Foo' with errors empty.

Suggested approach

In parseScalar (or in parseFrontmatter where line numbers are known), when a trimmed value starts with " or ' and does not end with the matching quote, push line N: "key" opens a quote that is never closed. Same for list items.

Done when

lib.test.mjs has a rejecting case; npm run validate fails on a fixture with an unterminated quote and names the line.

Lingua principale
JavaScript
Stelle
58
Fork
15
Merge medio
16h 53m
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/Free-Game-Dev-Assets

Tutte le issue di TMHSDigital/Free-Game-Dev-Assets

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.