2022-04-19 04:15:29 +00:00
|
|
|
{{ $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 }}
|
2022-04-21 00:55:13 +00:00
|
|
|
{{ else if strings.HasPrefix $k "str" }}
|
|
|
|
{{ $after := printf `<strong translate="yes">%s</strong>` $v }}
|
|
|
|
{{ $contents = $contents | replaceRE $v $after }}
|
2022-04-19 04:15:29 +00:00
|
|
|
{{ 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>
|