Tweak regex to avoid multiple spaces

This commit is contained in:
Will Boyd
2024-02-26 11:47:17 -05:00
parent 635451a4e3
commit 755f752019
+1 -1
View File
@@ -1,5 +1,5 @@
// get excerpt, not decoded, newlines collapsed
module.exports = (post) => {
const excerpt = post.data.encoded[1].replace(/[(\r\n|\n|\r)]/gm, " ");
const excerpt = post.data.encoded[1].replace(/[\r\n]+/gm, ' ');
return excerpt;
};