Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#138 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
content, testing

调研方向

先阅读 site/lib/frontmatter.mjs 和 lib.test.mjs;检查 parseScalar 如何处理带引号的值,以及 frontmatter 错误如何报告行号。添加拒绝未闭合引号标量和列表项的用例,然后运行 npm run validate,并确认 fixture 报告未闭合引号所在的行。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
JavaScript
星标
58
派生
15
平均合并
16 小时 53 分钟
30 天内合并 PR
14

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/Free-Game-Dev-Assets 的其他 Issue

查看 TMHSDigital/Free-Game-Dev-Assets 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。