Lighthouse: Missing ending of div

Created on 9 Apr 2019  Â·  3Comments  Â·  Source: GoogleChrome/lighthouse

Provide the steps to reproduce

  1. Run LH locally
  2. Open the html
  3. Search for lh-header-container

What is the current behavior?

I have tried to beautify the file with prettier with the node API (for better reading) and it always throws: Unexpected closing tag "template". This seems to be because the above described div is not closing and therefore prettier has problems to find the closing tag.

What is the expected behavior?

Correct HTML syntax


<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
</head>
<body class="lh-root lh-vars">
  <template id="tmpl-lh-heading">
    <div class="lh-header-container">
      <div class="lh-header">
        <div class="lh-lighthouse">
        </div>
        <div class="lh-metadata">
          <div class="lh-metadata__results"><a href="" class="lh-metadata__url" target="_blank" rel="noopener"></a></div>
          <div class="lh-config">
            <span class="lh-config__timestamp"></span>
            <a href="#runtime-settings" class="lh-config__emulation"></a>
          </div>
        </div>
      </div>
      <!-- HERE -->
  </template>
</body>
</html>

Environment Information

  • Affected Channels: Node
  • Lighthouse version: 4.3.0
  • Node.js version: 10.15.1
  • Operating System: macOS 10.14.4
  • prettier: 1.16.4

Related issues

bug good first issue

All 3 comments

Thanks for filing @muuvmuuv right you are! Interested in a PR to fix it? 😉

It would be adding </div> right here
https://github.com/GoogleChrome/lighthouse/blob/01b217be64ddff7ca500ad0f787f914fa9900b73/lighthouse-core/report/html/templates.html#L524-L526

we should add an html linter. and a css one too while we're at it.

@patrickhulce I'll take on this and see if I can set up linter's as well @Hoten

Was this page helpful?
0 / 5 - 0 ratings

Related issues

motiejuss picture motiejuss  Â·  3Comments

devrsi0n picture devrsi0n  Â·  3Comments

johnfrancisli picture johnfrancisli  Â·  3Comments

workjalexanderfox picture workjalexanderfox  Â·  3Comments

nl-igor picture nl-igor  Â·  3Comments