Skip to content

Commit 9a62727

Browse files
author
patched.codes[bot]
committed
Patched WebContent/swagger/lib/marked.js
1 parent 03fae59 commit 9a62727

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

WebContent/swagger/lib/marked.js

Lines changed: 3 additions & 2 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,8 +1098,9 @@ function unescape(html) {
10981098
function replace(regex, opt) {
10991099
regex = regex.source;
11001100
opt = opt || '';
1101+
const pattern = new RegExp(regex);
11011102
return function self(name, val) {
1102-
if (!name) return new RegExp(regex, opt);
1103+
if (!name) return pattern;
11031104
val = val.source || val;
11041105
val = val.replace(/(^|[^\[])\^/g, '$1');
11051106
regex = regex.replace(name, val);

0 commit comments

Comments
 (0)