Skip to content

Commit 193a41e

Browse files
committed
simplify tag regex
1 parent 7330a9c commit 193a41e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Slugger.js

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

0 commit comments

Comments
 (0)