Skip to content

Commit 74f9429

Browse files
committed
fix: regression from #1123
Since we are building the regex with `new RegExp`, the escapes must be double-escaped. Instead of `\.` to esape the period, we need `\\.`. Because that was not done, we were simply checking for *any* character, instead of a literal period.
1 parent 927ad28 commit 74f9429

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/netlify-cms-core/src/reducers/collections.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const selectors = {
3939
return `${ collection.get('folder').replace(/\/$/, '') }/${ slug }.${ this.entryExtension(collection) }`;
4040
},
4141
entrySlug(collection, path) {
42-
return path.split('/').pop().replace(new RegExp(`\.${ escapeRegExp(this.entryExtension(collection)) }$`), '');
42+
return path.split('/').pop().replace(new RegExp(`\\.${ escapeRegExp(this.entryExtension(collection)) }$`), '');
4343
},
4444
listMethod() {
4545
return 'entriesByFolder';

0 commit comments

Comments
 (0)