diff --git a/packages/decap-cms-lib-widgets/src/stringTemplate.ts b/packages/decap-cms-lib-widgets/src/stringTemplate.ts index 1675756f1db0..7c49f2a4fff7 100644 --- a/packages/decap-cms-lib-widgets/src/stringTemplate.ts +++ b/packages/decap-cms-lib-widgets/src/stringTemplate.ts @@ -175,6 +175,8 @@ export function compileStringTemplate( RegExp(templateVariablePattern, 'g'), (_full, key: string, _part, filter: string) => { let replacement; + key = key.trim(); + filter = filter.trim(); const explicitFieldReplacement = getExplicitFieldReplacement(key, data); if (explicitFieldReplacement) {