Skip to content

Support metadata on full-file URL snippets - #850

Merged
SimonCropp merged 1 commit into
SimonCropp:mainfrom
flcdrg:file-languages
Sep 26, 2026
Merged

SimonCropp merged 1 commit into
SimonCropp:mainfrom
flcdrg:file-languages

Conversation

@flcdrg

@flcdrg flcdrg commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Parse parenthesized metadata on full-file HTTP(S) snippet references without altering the URL used for download, caching, anchors, links, or missing-snippet reporting. A leading lang= token overrides the language inferred from the file extension, and remaining metadata is emitted as Expressive Code metadata. Metadata without lang= keeps the inferred language.

Reuse the source-snippet language parser so empty and invalid lang= values raise the same SnippetReadingException and diagnostics as existing snippet metadata. Preserve metadata when rewriting generated markers and apply overrides only to full-file URL references.

Add coverage for language-only and Expressive Code metadata, metadata-only directives, URL queries and fragments, invalid-language errors, and in-place rewrites. Document the syntax in readme.source.md and its generated readme.md.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Parse parenthesized metadata on full-file HTTP(S) snippet references without altering the URL used for download, caching, anchors, links, or missing-snippet reporting. A leading lang= token overrides the language inferred from the file extension, and remaining metadata is emitted as Expressive Code metadata. Metadata without lang= keeps the inferred language.

Reuse the source-snippet language parser so empty and invalid lang= values raise the same SnippetReadingException and diagnostics as existing snippet metadata. Preserve metadata when rewriting generated markers and apply overrides only to full-file URL references.

Add coverage for language-only and Expressive Code metadata, metadata-only directives, URL queries and fragments, invalid-language errors, and in-place rewrites. Document the syntax in readme.source.md and its generated readme.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@flcdrg

flcdrg commented Sep 26, 2026

Copy link
Copy Markdown
Contributor Author

Enhances the original resolution for #740

@SimonCropp
SimonCropp merged commit b9550b8 into SimonCropp:main Sep 26, 2026
3 checks passed
SimonCropp pushed a commit that referenced this pull request Sep 26, 2026
Parse parenthesized metadata on full-file HTTP(S) snippet references without altering the URL used for download, caching, anchors, links, or missing-snippet reporting. A leading lang= token overrides the language inferred from the file extension, and remaining metadata is emitted as Expressive Code metadata. Metadata without lang= keeps the inferred language.

Reuse the source-snippet language parser so empty and invalid lang= values raise the same SnippetReadingException and diagnostics as existing snippet metadata. Preserve metadata when rewriting generated markers and apply overrides only to full-file URL references.

Add coverage for language-only and Expressive Code metadata, metadata-only directives, URL queries and fragments, invalid-language errors, and in-place rewrites. Document the syntax in readme.source.md and its generated readme.md.
@SimonCropp SimonCropp added this to the 28.5.0 milestone Sep 26, 2026
@flcdrg
flcdrg deleted the file-languages branch September 26, 2026 10:52
This was referenced Sep 28, 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.

2 participants