Skip to content

Commit 1d0cd61

Browse files
hip3rdemshy
andauthored
fix: summary string transformations format (#7221) (#7313)
* fix: summary string transformations format (#7221) * fix: broken tests fix * refactor: summary string transformations code to pattern --------- Co-authored-by: Anze Demsar <anze.demsar@p-m.si>
1 parent c07719f commit 1d0cd61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/decap-cms-lib-widgets/src/stringTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const filters = [
3636
];
3737

3838
const FIELD_PREFIX = 'fields.';
39-
const templateContentPattern = '([^}{|]+)';
40-
const filterPattern = '( \\| ([^}{]+))?';
39+
const templateContentPattern = ' *([^}{| ]+)';
40+
const filterPattern = '( \\| ([^}{]+?))? *';
4141
const templateVariablePattern = `{{${templateContentPattern}${filterPattern}}}`;
4242

4343
// prepends a Zero if the date has only 1 digit

0 commit comments

Comments
 (0)