Skip to content

Commit

Permalink
Fix for regexp replacements used by verify steps (#126)
Browse files Browse the repository at this point in the history
* Fix regex replaces in isomorphic verify step

* Fix regex replaces in css2 verify step

* Fix regex replaces in two more exercises
  • Loading branch information
Thorarin authored and DusanSacha committed Jun 24, 2017
1 parent 5ee75f9 commit ef005a3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 28 deletions.
11 changes: 4 additions & 7 deletions exercises/css2/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,10 @@ function query(mode) {
if (err) {
exercise.emit('fail', exercise.__('fail.connection', {address: url, message: err.message}));
} else {
var data = _data.toString().replace(/data-react-checksum=".{1,20}"/, "");
while (data.match(/data-reactid=".{1,20}"/)) {
data = data.replace(/data-reactid=".{1,20}"/, "");
}
while (data.match(/data-reactid=".{1,35}"/)) {
data = data.replace(/data-reactid=".{1,35}"/, "");
}
var data = _data.toString().replace(/data-react-checksum="[^"]{1,20}"/, "");
data = data.replace(/data-reactroot=""/, "");
data = data.replace(/data-reactid="[^"]{1,35}"/gm, "");
data = data.replace(/data-reactid="[^"]{1,35}"/gm, "");
data = beautify_html(data, null);
stream.write(data);
}
Expand Down
10 changes: 3 additions & 7 deletions exercises/event/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,9 @@ function query(mode) {
if (err) {
exercise.emit('fail', exercise.__('fail.connection', {address: url, message: err.message}));
} else {
var data = _data.toString().replace(/data-react-checksum=".{1,20}"/, "");
while (data.match(/data-reactid=".{1,20}"/)) {
data = data.replace(/data-reactid=".{1,20}"/, "");
}
while (data.match(/data-reactid=".{1,35}"/)) {
data = data.replace(/data-reactid=".{1,35}"/, "");
}
var data = _data.toString().replace(/data-react-checksum="[^"]{1,20}"/, "");
data = data.replace(/data-reactroot=""/, "");
data = data.replace(/data-reactid="[^"]{1,35}"/gm, "");
data = beautify_html(data, null);
stream.write(data);
}
Expand Down
11 changes: 4 additions & 7 deletions exercises/isomorphic/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,10 @@ function query(mode) {
if (err) {
exercise.emit('fail', exercise.__('fail.connection', {address: url, message: err.message}));
} else {
var data = _data.toString().replace(/data-react-checksum=".{1,20}"/, "");
while (data.match(/data-reactid=".{1,20}"/)) {
data = data.replace(/data-reactid=".{1,20}"/, "");
}
while (data.match(/data-reactid=".{1,35}"/)) {
data = data.replace(/data-reactid=".{1,35}"/, "");
}
var data = _data.toString().replace(/data-react-checksum="[^"]{1,20}"/, "");
data = data.replace(/data-reactroot=""/, "");
data = data.replace(/data-reactid="[^"]{1,35}"/g, "");
data = data.replace(/data-reactid="[^"]{1,35}"/g, "");
data = beautify_html(data, null);
stream.write(data);
}
Expand Down
11 changes: 4 additions & 7 deletions exercises/prop_and_state/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,10 @@ function query(mode) {
exercise.emit('fail', exercise.__('fail.connection', {address: url, message: err.message}));
return;
} else {
var data = _data.toString().replace(/data-react-checksum=".{1,20}"/, "");
while (data.match(/data-reactid=".{1,20}"/)) {
data = data.replace(/data-reactid=".{1,20}"/, "");
}
while (data.match(/data-reactid=".{1,35}"/)) {
data = data.replace(/data-reactid=".{1,35}"/, "");
}
var data = _data.toString().replace(/data-react-checksum="[^"]{1,20}"/, "");
data = data.replace(/data-reactroot=""/, "");
data = data.replace(/data-reactid="[^"]{1,35}"/gm, "");
data = data.replace(/data-reactid="[^"]{1,35}"/gm, "");
data = beautify_html(data, null);
stream.write(data);
}
Expand Down

0 comments on commit ef005a3

Please sign in to comment.