fix(learn): colored markers - step 5 - validation (#47808)

pull/48032/head^2
Saul Blanco Tejero 2022-10-14 09:16:06 +02:00 committed by GitHub
parent 4f005bf3e2
commit 1ba9624b5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,8 @@ Your new `meta` element should have a `name` attribute set to `viewport`, and a
```js
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => m?.getAttribute('name') === 'viewport' && m?.getAttribute('content') === 'width=device-width, initial-scale=1.0');
const reValidContent = /^\s*width\s*=\s*device-width\s*,\s*initial-scale\s*=\s*1(?:\.0)?\s*$/;
const target = meta?.find(m => m?.getAttribute('name') === 'viewport' && reValidContent.test(m?.getAttribute('content')));
assert.exists(target);
```