simplify tag regex

This commit is contained in:
Tony Brix 2020-03-21 22:05:06 -05:00
parent 7330a9ca3d
commit 193a41e78d

View File

@ -14,7 +14,7 @@ module.exports = class Slugger {
.toLowerCase() .toLowerCase()
.trim() .trim()
// remove html tags // remove html tags
.replace(/<!?\/?[\w-]+(?: .*)?\/?>/g, '') .replace(/<[!\/a-z].*?>/ig, '')
// remove unwanted chars // remove unwanted chars
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '') .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
.replace(/\s/g, '-'); .replace(/\s/g, '-');