{{ define "main" }}
{{- $content := .Content -}}
{{- $content = replaceRE `<div class="footnotes" role="doc-endnotes">` "" $content -}}
{{- $content = replaceRE `</div>\s*$` "" $content -}}
{{- $tmp := $content | safeHTML -}}
{{ $sections := split $tmp "<h2" }}
{{ range after 1 $sections }}
<section>
{{ print "<h2" . | safeHTML }}
</section>
{{ end }}
{{ end }}
