Skip to content

Commit

Permalink
fix: summary string transformations format (#7221) (#7313)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
hip3r and demshy authored Nov 12, 2024
1 parent c07719f commit 1d0cd61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/decap-cms-lib-widgets/src/stringTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const filters = [
];

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

// prepends a Zero if the date has only 1 digit
Expand Down

0 comments on commit 1d0cd61

Please sign in to comment.