This repository was archived by the owner on May 29, 2026. It is now read-only.
Fix frontmatter parameter interpolation in markdown scripts#1905
Merged
Conversation
… fix Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Q: markdown scripts in this project support params and vars, but when i defined params using frontmatter, and use the defined params as {{ param }}, the value doesn't get replaced
A: The frontmatter parameters are being parsed but never connected to t...
Fix frontmatter parameter interpolation in markdown scripts
Aug 22, 2025
pelikhan
approved these changes
Aug 22, 2025
Contributor
|
Warning LLM error (403): error
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes the issue where frontmatter parameters defined in markdown scripts were not being used for variable interpolation with
{{ param }}syntax.Problem
When markdown scripts defined parameters in frontmatter like this:
The
{{name}}variable was not being replaced with the default value "World" during interpolation. The frontmatter parameters were being parsed but never connected to the variable resolution system.Root Cause
The
interpolateVariables()function inmustache.tswas callingsplitMarkdown()to extract content and discard frontmatter, meaning frontmatter parameters never made it into the variable interpolation process.Solution
This PR modifies both
mustache.tsandtemplate.tsto properly extract and use frontmatter parameters during variable interpolation:interpolateVariables()to extract frontmatter parameters and merge them with provided dataparametersand promptyinputs+sampleformatsSupported Formats
Standard format:
Prompty format:
Key Features
parametersand promptyinputs+sampleformatsTesting
Added 6 new test cases covering:
All existing functionality remains unchanged and working as expected.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.sheetjs.comnode /home/REDACTED/.local/share/pnpm/.tools/pnpm/10.12.3/bin/pnpm install(dns block)esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.