Skip to content

Commit c01a1e2

Browse files
author
patched.codes[bot]
committed
Patched WebContent/swagger/lib/marked.js
1 parent d1bff76 commit c01a1e2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

WebContent/swagger/lib/marked.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Lexer.prototype.token = function(src, top, bq) {
308308
if (~item.indexOf('\n ')) {
309309
space -= item.length;
310310
item = !this.options.pedantic
311-
? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
311+
? item.replace(/^ {1,' + space + '}/gm, '')
312312
: item.replace(/^ {1,4}/gm, '');
313313
}
314314

@@ -1098,11 +1098,10 @@ function unescape(html) {
10981098
function replace(regex, opt) {
10991099
regex = regex.source;
11001100
opt = opt || '';
1101-
return function self(name, val) {
1102-
if (!name) return new RegExp(regex, opt);
1103-
val = val.source || val;
1104-
val = val.replace(/(^|[^\[])\^/g, '$1');
1105-
regex = regex.replace(name, val);
1101+
return function self(name) {
1102+
if (!name) return new RegExp(regex + opt);
1103+
let val = (name.source || name).replace(/(^|[^\[])\^/g, '$1');
1104+
regex = regex.replace(new RegExp(val, 'g'), val);
11061105
return self;
11071106
};
11081107
}

0 commit comments

Comments
 (0)