Skip to content

Reject empty items in frontmatter lists - #244

Closed
harshkanhat wants to merge 1 commit into
TMHSDigital:mainfrom
harshkanhat:fix-frontmatter-empty-list-items
Closed

harshkanhat wants to merge 1 commit into
TMHSDigital:mainfrom
harshkanhat:fix-frontmatter-empty-list-items

Conversation

@harshkanhat

Copy link
Copy Markdown
Contributor

Closes #234

Summary

  • Treat a single trailing comma in a flow list as valid YAML syntax and ignore it.
  • Report internal empty flow-list items with the frontmatter line number instead of allowing empty strings into catalog data.
  • Reject empty quoted block-list items as well.
  • Require non-empty strings in the shared string-list schema.

Tests

  • Added regression coverage for a trailing flow-list comma, an empty flow-list item, and an empty quoted block-list item.
  • The test suite was not run in this environment; CI should verify the changes.

TMHSDigital added a commit that referenced this pull request Nov 6, 2026
The fixes these pull requests made had already landed on main, so their
branches conflict; these are the parts main did not have:

- data.schema.json: list items must be non-empty strings (minLength 1),
  from #244. schema-check.mjs gains minLength (by character) so the
  build's own schema check can enforce it.
- checks.test.mjs: a preview URL with an unclosed IPv6 bracket, and one
  carrying credentials, are refused rather than thrown, from #243.
- site/README.md: a paragraph on opensearch.xml, from #242.

Co-authored-by: harshkanhat <kanhatharsh@gmail.com>
Co-authored-by: bfs2021 <101915083+bfs2021@users.noreply.github.com>
Co-authored-by: Ritesh Yadav <riteshyadav33302111@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LpkeXQPaUhxjgqdqnk6BrJ
@TMHSDigital

Copy link
Copy Markdown
Owner

Thank you! #234 was fixed on main in 4b7fd13 while this was open (one trailing comma ends the list, any other empty item is a line error), so this branch now conflicts and I'm closing it as superseded.

Your minLength: 1 on stringList items in data.schema.json was something main didn't have, so I folded it in (a3cd8b0, with you as co-author). One thing worth knowing: the build validates data.json with a small zero-dependency checker (site/lib/schema-check.mjs) that refuses keywords it doesn't implement, so on current main that change alone stops the build. I added minLength support to the checker in the same commit.

@TMHSDigital TMHSDigital closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trailing comma or empty item in a frontmatter list adds "" to tags and passes validate

2 participants