Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Markdown frontmatter YAML parsing path to preserve quoted numeric scalars as strings (fixing #50) by converting from zig-yaml’s Tree nodes rather than the scalar Value API that loses quoting style.
Changes:
- Switch YAML-to-JSON conversion to a
Tree-node based walker that treats quoted scalars as strings and only coerces unquoted scalars to numbers. - Adjust YAML frontmatter memory management to use an arena for the generated
std.json.Valuetree. - Update/add tests to assert integer parsing (including negatives) and that quoted numeric strings remain strings.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/markdown/frontmatter.zig |
Reworks YAML conversion to use yaml.Tree nodes (with quoting awareness) and changes ownership/deinit strategy for YAML-derived JSON values. |
src/markdown/frontmatter_test.zig |
Updates numeric expectations to .integer and adds a test ensuring quoted numeric scalars remain .string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/sc2in/zigmark/sessions/8d11af91-f8da-453b-a5a3-8148aa6a507f Co-authored-by: tsunaminoai <3594035+tsunaminoai@users.noreply.github.com>
Head branch was pushed to by a user without write access
tsunaminoai
left a comment
There was a problem hiding this comment.
Looks good to my eyes
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… notation round-trip) Agent-Logs-Url: https://github.com/sc2in/zigmark/sessions/2c047116-1248-491b-b7f9-fe0a79778218 Co-authored-by: tsunaminoai <3594035+tsunaminoai@users.noreply.github.com>
Head branch was pushed to by a user without write access
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… treeNodeToJson Agent-Logs-Url: https://github.com/sc2in/zigmark/sessions/bec0d6f6-29c0-46e0-8496-a3fb365909f0 Co-authored-by: tsunaminoai <3594035+tsunaminoai@users.noreply.github.com>
Head branch was pushed to by a user without write access
yamlNeedsQuoteto quote strings that would be re-parsed as integers or floats (usinginferValue).valuecase oftreeNodeToJson(empty unquoted scalar →.null, restoring original behavior)inferValuewithtreeNodeToJsoncoercion: remove'.'dot-guard, always tryparseFloatafterparseIntfails (fixes scientific notation like1e3)"1e3"(scientific notation)inferValuedocstring: "numeric coercion mirrorstreeNodeToJson; bool/null handling is additional and not present intreeNodeToJson"