Repository navigation
fix: resolve extension language and metadata files from the document - #15274
Merged
cderv merged 6 commits intoNov 4, 2026
Merged
Conversation
A format extension that points `language` at its own file stops the render, and its `metadata-files` are ignored. These documents check both, with per-language files, an organisation folder, a subfolder, and a project with nested documents.
The paths in `_extension.yml` are already rewritten relative to the document folder, but the format was resolved against the parent of the extension folder. Pass the document instead, so `language` and `metadata-files` point at the files inside the extension. Fixes quarto-dev#15063.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
mcanouil
marked this pull request as ready for review
November 3, 2026 23:25
cderv
approved these changes
Nov 4, 2026
cderv
left a comment
Member
There was a problem hiding this comment.
Thanks, LGTM.
Paths inside the files listed in an extension's metadata-files still resolve against the document (e.g. language: _language.yml in that file), like a document's own metadata-files do. This is a broader behavior of metadata-files, so I'll look at it in a follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A format extension that sets
language: _language.ymlnow finds the file inside its own directory, so the render no longer stops with "Specified 'language' file does not exist".The same fix makes
metadata-filesin an extension format work; until now they were skipped without any message.resolveExtensionPathsalready rewrites the paths of_extension.ymlrelative to the document's directory.readExtensionFormatthen passedextension.pathtoresolveFormatsFromMetadata, which takes thedirnameof its input as the base, so the paths were joined to the parent of the extension directory and gave_extensions/_extensions/<name>/_language.yml.It now passes the document, the same path that
resolveExtensionPathsused.The smoke-all tests cover per-language files, organisation directories, subfolders, document overrides,
metadata-files, and a project.The project's subdirectory document passed before the fix by chance, as the two wrong bases cancel out one level down; it stays as a guard.
When the named
languagefile does not exist, the error still shows a path in the document's directory rather than the extension's, becausetoInputRelativePathsonly rewrites paths that exist.That is shared with every other path in
_extension.yml, so it is left out of this change.Closes #15063.
Checklist
I have (if applicable):