ash = window.location.hash
        if (!hash) {
          return
        }
        let el = document.getElementById(hash.slice(1)) // remove leading '#'
        if (!el) {
          return
        }

        let details = el.closest("details")
        while (details) {
          details.open = true
          details = details.parentElement.closest("details")
        }

        // New elements may have appeared.
        // Set hash again to scroll to the right place.
        window.location.hash = hash;
    