Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pkg/parser/frontmatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,15 @@ func processIncludesWithVisited(content, baseDir string, extractTools bool, visi
if directive != nil {
// Emit deprecation warning for legacy syntax
if directive.IsLegacy {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Deprecated syntax: '%s'. Use '{{#import%s %s}}' instead.",
// Security: Escape strings to prevent quote injection in warning messages
// Use %q format specifier to safely quote strings containing special characters
optionalMarker := ""
if directive.IsOptional {
optionalMarker = "?"
}
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Deprecated syntax: %q. Use {{#import%s %s}} instead.",
directive.Original,
map[bool]string{true: "?", false: ""}[directive.IsOptional],
optionalMarker,
directive.Path)))
}

Expand Down