{{ $inn := .Inner | $.Page.RenderString }}
<div class="glosscontainer">
  <div class="gloss">
    {{- range $g := (split $inn "\n") -}}
      {{- if hasPrefix $g "{r}" -}}
        <div class="glossregular">
          {{- substr $g 3 | htmlUnescape | safeHTML -}}
        </div>
      {{- else if hasPrefix $g "{g}" -}}
        <div class="glossline">
          {{- range (split (substr $g 3) "|") -}}
            {{- with . -}}
              <div class="glosswords">
                {{- range (split . "," ) -}}
                  <div class="glossword">{{- . | htmlUnescape | safeHTML -}}</div>
                {{- end -}}
              </div>
            {{- end -}}
          {{- end -}}
        </div>
      {{- end -}}
    {{- end -}}
  </div>
  <div class="glossnumber {{ with $.Page.Params.glossnumberAuto }}glossnumberAuto{{ end }}">{{ with .Get 0 }}{{ . }}{{ end}}</div>
</div>
