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) <nhcarrigan@gmail.com>

Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
This commit is contained in:
Sem Bauke
2021-05-06 06:36:33 +02:00
committed by GitHub
parent 411ce3002c
commit 607b1c3dbf
3 changed files with 4 additions and 5 deletions

View File

@ -52,7 +52,7 @@ assert($('img').length);
Your image should have a `src` attribute that points to the kitten image. Your image should have a `src` attribute that points to the kitten image.
```js ```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. Your image element's `alt` attribute should not be empty.

View File

@ -37,9 +37,8 @@ assert(
Your `form` should have an `action` attribute which is set to `https://www.freecatphotoapp.com/submit-cat-photo` Your `form` should have an `action` attribute which is set to `https://www.freecatphotoapp.com/submit-cat-photo`
```js ```js
assert( const action = $('form').attr('action');
$('form').attr('action') === 'https://www.freecatphotoapp.com/submit-cat-photo' assert(action.match(/^https:\/\/(www\.)?freecatphotoapp\.com\/submit-cat-photo$/i))
);
``` ```
Your `form` element should have well-formed open and close tags. Your `form` element should have well-formed open and close tags.

View File

@ -34,7 +34,7 @@ assert(/cat photos/gi.test($('a').text()));
You need an `a` element that links to `https://www.freecatphotoapp.com` You need an `a` element that links to `https://www.freecatphotoapp.com`
```js ```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. Your `a` element should have a closing tag.