Merge pull request #10518 from BerkeleyTrue/fix/escaping-quotes

Fix(challenge): Escaping Quote
This commit is contained in:
Quincy Larson
2016-09-08 21:57:56 -07:00
committed by GitHub

View File

@ -1074,24 +1074,22 @@
], ],
"releasedOn": "January 1, 2016", "releasedOn": "January 1, 2016",
"challengeSeed": [ "challengeSeed": [
"var myStr; // Change this line", "var myStr = \"\"; // Change this line",
"", "",
"" ""
], ],
"tail": [ "tail": [
"(function(){", "(function(){",
" if(typeof myStr === 'string') {", " if(typeof myStr === 'string') {",
" return \"myStr = \" + myStr;", " console.log(\"myStr = \\\"\" + myStr + \"\\\"\");",
" } else {", " } else {",
" return \"myStr is undefined\";", " console.log(\"myStr is undefined\");",
" }", " }",
"})();" "})();"
], ],
"solutions": [ "solutions": [],
"var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"
],
"tests": [ "tests": [
"assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (<code>&quot;</code>) and four escaped double quotes (<code>&#92;&quot;</code>).');", "assert(code.match(/\\\\\"/g).length === 6 && code.match(/[^\\\\]\"/g).length === 10, 'message: You should use two double quotes (<code>&quot;</code>) and four escaped double quotes (<code>&#92;&quot;</code>).');",
"assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');" "assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');"
], ],
"type": "waypoint", "type": "waypoint",