Fixing JSON feed
Build and copy to prod / build-and-copy (push) Successful in 2m13s

This commit is contained in:
Lewis Dale committed 2024-04-29 19:15:50 +01:00
1 parent defc675783
commit 5eab7bcb9d
7 files changed
+49 -7

No files matched your search

+3 -1
View File
@@ -1,5 +1,7 @@
const createExcerpt = (post, limit ) => {
const withoutTags = post.content.replace(/(<([^>]+)>)/gi, "");
const withoutTags = post.content.replace(/(<([^>]+)>)/gi, "")
.replace(/[^\x20-\x7E]/gmi, " ")
.replace(/\s+/g, " ").trim();
if (withoutTags.length > limit) {
return withoutTags.slice(0, limit) + " […]";