This commit is contained in:
1 parent
defc675783
commit
5eab7bcb9d
7 files changed
+49
-7
No files matched your search
@@ -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) + " […]";
|
||||
|
||||
Reference in new issue
Block a user