Skip to content

scan: accept '#' in tag URIs - #505

Closed
Baltsat wants to merge 3 commits into
pantoniou:masterfrom
Baltsat:fix-tag-uri-hash
Closed

Baltsat wants to merge 3 commits into
pantoniou:masterfrom
Baltsat:fix-tag-uri-hash

Conversation

@Baltsat

@Baltsat Baltsat commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

fy_is_uri() is missing '#'. it is part of ns-uri-char in yaml 1.2.2, so valid tags fail today:

$ printf -- '- !<tag:example.com,2000:app/foo#bar> x\n' | fy-tool --testsuite -
stdin:1:33: error: missing '>' uri terminator
$ printf -- '- !foo#bar x\n' | fy-tool --testsuite -
stdin:1:7: error: invalid tag terminator

with the patch:

=VAL <tag:example.com,2000:app/foo#bar> :x
=VAL <!foo#bar> :x

!<foo #bar> x still errors, the space ends the uri and # starts a comment. %23 already worked, only the literal char was missing.

added parse_bug_tag_uri_hash to test/libfyaml-test-parse-bugs.c: four valid inputs with the expected tag (verbatim, !<foo#>, local !foo#bar, %TAG handle + !e!x#y) and !<foo #bar> x as invalid. it fails before the change and passes after. full ctest: 4898 passed, 0 failed (18 disabled as before). yaml-test-suite --testsuite output is byte-identical before and after on all 402 cases, and yaml-reference-parser emits the same events as above.

found it while diffing yaml implementations against each other for an eval i'm building.

'#' is an ns-uri-char in YAML 1.2.2, so it belongs to verbatim tags and tag shorthand suffixes. fy_is_uri() did not list it.
Copilot AI balanced review requested due to automatic review settings November 5, 2026 05:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T00:13:47.878206Z 23bb1c3 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@pantoniou

Copy link
Copy Markdown
Owner

merged manually 044a31d

@pantoniou pantoniou closed this Nov 9, 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.

3 participants