Skip to content

Commit 17ee15f

Browse files
author
MarkedJS bot
committed
build [skip ci]
1 parent 58e9fed commit 17ee15f

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

lib/marked.esm.js

+7
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,9 @@ var Slugger_1 = class Slugger {
11431143
let slug = value
11441144
.toLowerCase()
11451145
.trim()
1146+
// remove html tags
1147+
.replace(/<[!\/a-z].*?>/ig, '')
1148+
// remove unwanted chars
11461149
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
11471150
.replace(/\s/g, '-');
11481151

@@ -1474,6 +1477,10 @@ var TextRenderer_1 = class TextRenderer {
14741477
return text;
14751478
}
14761479

1480+
html(text) {
1481+
return text;
1482+
}
1483+
14771484
text(text) {
14781485
return text;
14791486
}

lib/marked.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,9 @@
10491049
var _proto = Slugger.prototype;
10501050

10511051
_proto.slug = function slug(value) {
1052-
var slug = value.toLowerCase().trim().replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-');
1052+
var slug = value.toLowerCase().trim() // remove html tags
1053+
.replace(/<[!\/a-z].*?>/ig, '') // remove unwanted chars
1054+
.replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-');
10531055

10541056
if (this.seen.hasOwnProperty(slug)) {
10551057
var originalSlug = slug;
@@ -1401,6 +1403,10 @@
14011403
return text;
14021404
};
14031405

1406+
_proto.html = function html(text) {
1407+
return text;
1408+
};
1409+
14041410
_proto.text = function text(_text) {
14051411
return _text;
14061412
};

0 commit comments

Comments
 (0)