fix(curriculum): prevent passing in case of <img> element not closed (#54644)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
zxc-w
2024-05-06 18:25:53 +02:00
committed by GitHub
co-authored by Huyen Nguyen
parent 686f2fa23b
commit 7606a05ca7
@@ -45,6 +45,12 @@ Although you have set the `img` element's `src` to the correct URL, it is recomm
assert(!/\<img\s+src\s*=\s*https:\/\/cdn\.freecodecamp\.org\/curriculum\/cat-photo-app\/relaxing-cat\.jpg/.test(code));
```
Your `img` element should be closed either with `>` or `/>`.
```js
assert(/<img\s+src\s*=\s*("|')https:\/\/cdn\.freecodecamp\.org\/curriculum\/cat-photo-app\/relaxing-cat\.jpg\1\s*\/?>/.test(code));
```
# --seed--
## --seed-contents--