From 2681249b8eeeb0fc650577494b980bb1fadb1de6 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sun, 31 May 2015 13:43:00 -0700 Subject: [PATCH] start making closing tag matching more robust --- seed_data/challenges/basic-html5-and-css.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seed_data/challenges/basic-html5-and-css.json b/seed_data/challenges/basic-html5-and-css.json index da66eff5763..46d95747a28 100644 --- a/seed_data/challenges/basic-html5-and-css.json +++ b/seed_data/challenges/basic-html5-and-css.json @@ -53,7 +53,7 @@ ], "tests": [ "assert(($('h2').length > 0), 'Create an h2 element.')", - "assert(new RegExp('', 'gi').test(editor), 'Be sure to complete your h2 element with a closing tag.')", + "assert(editor.match(/<\\/h2>/g) && editor.match(/<\\/h2>/g).length === editor.match(/

/g).length, 'Be sure that your h2 element has a closing tag.')", "assert.isTrue((/cat(\\s)?photo(\\s)?app/gi).test($('h2').text()), 'Your h2 element should have the text \"CatPhotoApp\"')", "assert.isTrue((/hello(\\s)+world/gi).test($('h1').text()), 'Your h1 element should have the text \"Hello World\"')" ], @@ -2125,7 +2125,7 @@ "assert($('div').children('ol').length > 0, 'Wrap your ol element inside your div element.')", "assert($('div').children('p').length > 1, 'Wrap your p element inside your div element.')", "assert($('div').children('ul').length > 0, 'Wrap your ul element inside your div element.')", - "assert(editor.match(/<\\/div>/g), 'Be sure that your div element has a closing tag.')" + "assert(editor.match(/<\\/div>/g) && editor.match(/<\\/div>/g).length === editor.match(/
/g).length, 'Be sure that your div element has a closing tag.')" ], "challengeSeed": [ "",