Skip to content
Merged
Changes from all commits
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
14 changes: 14 additions & 0 deletions crates/goose/src/recipe/template_recipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ fn filter_unparseable_variables(template_variables: &[String]) -> Result<Vec<Str
let mut vars_to_convert = Vec::new();

for var in template_variables {
let trimmed = var.trim();

if trimmed.starts_with('\'') || trimmed.starts_with('"') {
continue;
}

let mut env = Environment::new();
env.set_undefined_behavior(UndefinedBehavior::Lenient);

Expand Down Expand Up @@ -280,5 +286,13 @@ description: "A test recipe"

assert!(result.contains(r#"name: "Simple Recipe""#));
}

#[test]
fn test_jinja_escape_syntax() {
let content = r#"{{'{{param_key}}'}}"#;
let params = HashMap::from([("recipe_dir".to_string(), "test_dir".to_string())]);
let result = render_recipe_content_with_params(content, &params).unwrap();
assert_eq!(result, "{{param_key}}");
}
}
}