Fixed RegEx to be super accurate again

This commit is contained in:
benmcmahon100
2015-08-25 21:03:50 +01:00
parent 16cd733dd3
commit 8509197b6d

View File

@ -476,7 +476,7 @@ function bonfireExecute() {
ga('send', 'event', 'Challenge', 'ran-code', challenge_Name);
userTests = null;
$('#testSuite').empty();
if(challengeType !== "0"){
if(challengeType !== "0" && !editor.getValue().match(/\$\s*?\(\s*?\$\s*?\)/gi)){
var userJavaScript = myCodeMirror.getValue();
var failedCommentTest = false;
if (userJavaScript.match(/\/\*/gi) && userJavaScript.match(/\*\//gi) == null) {
@ -520,7 +520,7 @@ function bonfireExecute() {
editor.setValue(editor.getValue() + "-->");
editorValueForIFrame = editorValueForIFrame + "-->";
}
if(!editor.getValue().match(/\$\(\$\)/gi) && challengeType === "0") {
if(!editor.getValue().match(/\$\s*?\(\s*?\$\s*?\)/gi) && challengeType === "0") {
safeHTMLRun(true);
}
}