From 607b1c3dbfdcfab9a3847c0f0f91205e3224e946 Mon Sep 17 00:00:00 2001 From: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Date: Thu, 6 May 2021 06:36:33 +0200 Subject: [PATCH] fix(curriculum): look for possible www link in regex (#41955) * fix(curriculum): look for possible www. link in regex * Add suggestions from Nick Co-authored-by: Nicholas Carrigan (he/him) Co-authored-by: Nicholas Carrigan (he/him) --- .../basic-html-and-html5/add-images-to-your-website.md | 2 +- .../basic-html-and-html5/create-a-form-element.md | 5 ++--- .../link-to-external-pages-with-anchor-elements.md | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.md index c3f4297d85..f018d4eb2f 100644 --- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.md +++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/add-images-to-your-website.md @@ -52,7 +52,7 @@ assert($('img').length); Your image should have a `src` attribute that points to the kitten image. ```js -assert(/^https:\/\/www\.bit\.ly\/fcc-relaxing-cat$/i.test($('img').attr('src'))); +assert(/^https:\/\/(www\.)?bit\.ly\/fcc-relaxing-cat$/i.test($('img').attr('src'))); ``` Your image element's `alt` attribute should not be empty. diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-a-form-element.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-a-form-element.md index 5486eb604a..2e18c529b7 100644 --- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-a-form-element.md +++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/create-a-form-element.md @@ -37,9 +37,8 @@ assert( Your `form` should have an `action` attribute which is set to `https://www.freecatphotoapp.com/submit-cat-photo` ```js -assert( - $('form').attr('action') === 'https://www.freecatphotoapp.com/submit-cat-photo' -); +const action = $('form').attr('action'); +assert(action.match(/^https:\/\/(www\.)?freecatphotoapp\.com\/submit-cat-photo$/i)) ``` Your `form` element should have well-formed open and close tags. diff --git a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements.md b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements.md index f18bbb0d2d..de03963417 100644 --- a/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements.md +++ b/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements.md @@ -34,7 +34,7 @@ assert(/cat photos/gi.test($('a').text())); You need an `a` element that links to `https://www.freecatphotoapp.com` ```js -assert(/^https?:\/\/www\.freecatphotoapp\.com\/?$/i.test($('a').attr('href'))); +assert(/^https?:\/\/(www\.)?freecatphotoapp\.com\/?$/i.test($('a').attr('href'))); ``` Your `a` element should have a closing tag.