mirror of
https://github.com/markedjs/marked
synced 2024-11-23 09:48:17 +00:00
simplify tag regex
This commit is contained in:
parent
7330a9ca3d
commit
193a41e78d
@ -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, '-');
|
||||||
|
Loading…
Reference in New Issue
Block a user