GoogleChrome / GoogleChrome/webdev-infra

Linting for invalid frontmatter/incorrect inline HTML

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
39
Forks
29
PR merge metrics
No merged PRs in 30d

Description

There are a number of posts on web.dev that have either errors in their frontmatter or invalid inline HTML within their Markdown, and the resulting HTML is syntacticly invalid. This results in the following errors when trying to minify the HTML during a production build, and could lead to incorrect rendering of the final page, depending on how severe the error is.

We should add some linting (ideally here, so we can share it with d.c.c.) to catch syntax errors in the final HTML output, and warn when that happens.

The current output for web.dev when there's a failure looks like

```sh
Could not minify html for dist/i18n/de/samesite-cookies-explained/index.html
Could not minify html for dist/bfcache/index.html
Could not minify html for dist/goibibo/index.html
Could not minify html for dist/love-your-cache/index.html
Could not minify html for dist/more-variable-font-options-in-chromium-83/index.html
Could not minify html for dist/samesite-cookies-explained/index.html
Could not minify html for dist/speed-tooling-evolutions-cds-2019/index.html
Could not minify html for dist/tokopedia/index.html
Could not minify html for dist/priority-hints/index.html
Could not minify html for dist/i18n/fr/samesite-cookies-explained/index.html
Could not minify html for dist/i18n/es/goibibo/index.html
Could not minify html for dist/i18n/es/samesite-cookies-explained/index.html
Could not minify html for dist/i18n/ja/optimize-lcp/index.html
Could not minify html for dist/i18n/ja/samesite-cookies-explained/index.html
Could not minify html for dist/i18n/ko/bluetooth/index.html
Could not minify html for dist/i18n/ko/hid/index.html
Could not minify html for dist/i18n/ko/samesite-cookies-explained/index.html
Could not minify html for dist/i18n/ko/usb/index.html
Could not minify html for dist/i18n/ko/web-share/index.html
Could not minify html for dist/i18n/pt/samesite-cookies-explained/index.html
Could not minify html for dist/i18n/zh/samesite-cookies-explained/index.html
Could not minify html for dist/i18n/ru/samesite-cookies-explained/index.html
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.