{{/* The visual identity of a specification as inline SVG markup. Uses the bundle's icon.svg when present, otherwise a sigil generated from the slug so every specification has a stable, distinct mark. Inline style attributes are rewritten to presentation attributes so a strict Content-Security-Policy never has to allow inline styles. */}} {{ $svg := "" }} {{ with .Resources.Get "icon.svg" }} {{ $svg = .Content }} {{ $svg = replaceRE `(?s)<\?xml.*?\?>` "" $svg }} {{ $svg = replaceRE `(?s)` "" $svg }} {{ $svg = replaceRE `(?s).*?` "" $svg }} {{ $svg = replaceRE `style="fill:\s*([^;"]+);?"` `fill="$1"` $svg }} {{ $svg = replaceRE `(]*?)\s(?:width|height)="[^"]*"` "$1" $svg }} {{ $svg = replaceRE `(]*?)\s(?:width|height)="[^"]*"` "$1" $svg }} {{ $svg = replace $svg "` $cells (add 3 (mul $col 4)) $y }} {{ if ne $col 2 }} {{ $cells = printf `%s` $cells (sub 19 (mul $col 4)) $y }} {{ end }} {{ else }} {{ $cells = printf `%s` $cells (string (add 4.5 (mul $col 4))) (string (add 4.5 (mul $row 4))) }} {{ if ne $col 2 }} {{ $cells = printf `%s` $cells (string (sub 20.5 (mul $col 4))) (string (add 4.5 (mul $row 4))) }} {{ end }} {{ end }} {{ end }} {{ end }} {{ $svg = printf `` $cells }} {{ end }} {{ return ($svg | safeHTML) }}