Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix URI template rendering #4

Open
Robsteranium opened this issue Nov 8, 2021 · 0 comments
Open

Fix URI template rendering #4

Robsteranium opened this issue Nov 8, 2021 · 0 comments

Comments

@Robsteranium
Copy link
Owner

Templates with {#var} are rewritten as #{var}, this doesn't comply with the spec for fragment expansion if the var is undefined.

Templates with an absolute URL e.g. http://example.org/countries.csv{#countryCode} have {+url} prepended erroneously (see e.g. "manifest-validation#test030").

Robsteranium added a commit that referenced this issue Nov 8, 2021
The URI template spec supports [fragment identifiers](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.4)
by expanding a template like `{#var}`. Glue interprets the hash char as a comment as it's inside curly braces.
[A recent change to glue](tidyverse/glue#224) flushed this out.

This patch rewrites the template as `#{var}`. This has the desired effect when the value is present but doesn't
conform with the spec properly as the whole fragment (including the `#`) should be omitted. This is raised in #4.
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

No branches or pull requests

1 participant