chore: update filters
This commit is contained in:
parent
350c4961d4
commit
185bab9ff4
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
const marked = require('marked')
|
||||
const sanitizeHTML = require('sanitize-html')
|
||||
const utmPattern = /[?&](utm_[^&=]+=[^&#]*)/gi
|
||||
|
||||
module.exports = {
|
||||
trim: (string, limit) => {
|
||||
|
@ -18,8 +19,7 @@ module.exports = {
|
|||
return string.replace(pattern, replacement)
|
||||
},
|
||||
stripUtm: (string) => {
|
||||
const pattern = /[?&](utm_[^&=]+=[^&#]*)/gi
|
||||
return string.replace(pattern, '')
|
||||
return string.replace(utmPattern, '')
|
||||
},
|
||||
getPostImage: (image) => {
|
||||
if (image && image !== '') return image
|
||||
|
@ -51,7 +51,7 @@ module.exports = {
|
|||
|
||||
const filtered =
|
||||
webmentions
|
||||
.filter((entry) => entry['wm-target'] === `https://coryd.dev${url}`)
|
||||
.filter((entry) => entry['wm-target'].replace(utmPattern, '') === `https://coryd.dev${url}`)
|
||||
.filter((entry) => allowedTypes.includes(entry['wm-property'])) || []
|
||||
|
||||
filtered.forEach((m) => {
|
||||
|
|
Reference in a new issue