1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-30 12:02:09 +00:00
seirdy.one/layouts/_default/_markup/render-codeblock-figure.html
Rohan Kumar eb8ca07b9f
Goldmark 1.4.12, switch to good unminified output
- Goldmark 1.4.12 switches footnotes from a <section> to a <div>; update
  regexes and stylesheet to account for this.
- Goldmark 1.4.12 allows multiple footnotes with the same reference; use
  that.
- Clean up templates for unminified output. Also delete an unused class.
- Switch to unminified output by default.
2022-04-25 08:49:13 -07:00

26 lines
726 B
HTML

{{ $contents := .Inner | htmlEscape -}}
{{- $samp := false -}}
{{- with .Attributes -}}
{{- range $k, $v := . -}}
{{- if strings.HasPrefix $k "var" -}}
{{- $after := printf `<var translate="yes">%s</var>` $v -}}
{{- $contents = $contents | replaceRE $v $after -}}
{{- else if strings.HasPrefix $k "str" -}}
{{- $after := printf `<strong translate="yes">%s</strong>` $v -}}
{{- $contents = $contents | replaceRE $v $after -}}
{{- else if and (eq $k "samp")}}
{{- $samp = $v -}}
{{- end -}}
{{- end -}}
{{- end -}}
<pre tabindex="0">
{{- if $samp -}}
<samp itemprop="text">
{{- $contents | safeHTML -}}
</samp>
{{- else -}}
<code itemprop="text">
{{- $contents | safeHTML -}}
</code>
{{- end -}}
</pre>