Skip to content

Commit 74832f9

Browse files
committed
Fix more exponential regular expressions
1 parent 4c81051 commit 74832f9

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

mode/erlang/erlang.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ CodeMirror.defineMode("erlang", function(cmCfg) {
339339
}
340340

341341
function lookahead(stream) {
342-
var m = stream.match(/([\n\s]+|%[^\n]*\n)*(.)/,false);
343-
return m ? m.pop() : "";
342+
return !stream.eol() ? m.pop() : "";
344343
}
345344

346345
function is_member(element,list) {

mode/markdown/markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
735735
if (stream.peek() === undefined) { // End of line, set flag to check next line
736736
state.linkTitle = true;
737737
} else { // More content on line, check if link title
738-
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\.)+\)))?/, true);
738+
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/, true);
739739
}
740740
state.f = state.inline = inlineNormal;
741741
return tokenTypes.linkHref + " url";

mode/python/python.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
}
283283

284284
function pushBracketScope(stream, state, type) {
285-
var align = stream.match(/^([\s\[\{\(]|#.*)*$/, false) ? null : stream.column() + 1
285+
var align = stream.match(/^[\s\[\{\(]*(?:#|$)/, false) ? null : stream.column() + 1
286286
state.scopes.push({offset: state.indent + hangingIndent,
287287
type: type,
288288
align: align})

0 commit comments

Comments
 (0)