mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 18:40:18 +00:00
fix(context): skip over empty keys to avoid replacing $ and breaking other values
This commit is contained in:
@@ -201,6 +201,10 @@ impl SproutContext {
|
||||
let mut result = text.as_ref().to_string();
|
||||
let mut did_change = false;
|
||||
for (key, value) in values {
|
||||
// Empty keys are not supported.
|
||||
if key.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let next_result = result.replace(&format!("${key}"), value);
|
||||
if result != next_result {
|
||||
did_change = true;
|
||||
|
||||
Reference in New Issue
Block a user