Missing closing </div>s automagically corrected

I made an experiment.
I copied the relevant part from Bulma’s navbar into a template.


{{ define "body" }}
<nav class="navbar" role="navigation" aria-label="main navigation">
  <div id="navbarBasicExample" class="navbar-menu">
    <div class="navbar-start">
      <a class="navbar-item">
        Home
      </a>

      <a class="navbar-item">
        Documentation
      </a>

      <div class="navbar-item has-dropdown is-hoverable">
        <a class="navbar-link">
          More
        </a>

        <div class="navbar-dropdown">
          <a class="navbar-item">
            About
          </a>
          <a class="navbar-item is-selected">
            Jobs
          </a>
          <a class="navbar-item">
            Contact
          </a>
          <hr class="navbar-divider">
          <a class="navbar-item">
            Report an issue
          </a>
        </div>
      </div>
    </div>
  </div>
</nav>
{{ end }}

Of course it rendered perfectly using bulma.css
Then, I deleted the last four closing </div>s on purpose.
The final part of the code was like this:

          <a class="navbar-item">
            Report an issue
          </a>
</nav>
{{ end }}

When I navigated to the page that was rendered using this crippled template and viewed the source (with CTRL+U), lo and behold, the closing divs were back, added by a mysterious (to me) entity, although they are still missing in the template.
My question: Who put them back?
Was it Hugo?
Was it the browser (Brave)?

It was you browser. HTML is very forgiving, with browsers commonly taking a ‘we know what you meant approach’.

As an aside, that is a very poor markup for a nav bar. No list elements? Pointless nav role on a nav element?

It was you browser

Thanks

As for the aside matter, can’t tell.
Please follow the link in the OP to get the info