0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00

Simplify bugify.html (#33063)

* use `in` instead of `strings.Contains` since the latter is not documented
* use `cond`
This commit is contained in:
XhmikosR 2021-02-15 21:08:44 +02:00 committed by GitHub
parent ce8af15ad1
commit 29674b8426
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,8 @@
{{- $words := (split . " ") -}}
{{- $words := split . " " -}}
{{- range $word := $words -}}
{{- if (strings.Contains $word "#") -}}
{{- $separator := false -}}
{{- if (strings.Contains $word ",") -}}
{{- $separator = true -}}
{{- end -}}
{{- if (in $word "#") -}}
{{- $has_separator := cond (in $word ",") true false -}}
{{- $data := split $word "#" -}}
{{- $bug_cat := replace (index $data 0) "\n" "" -}}
@ -32,7 +28,7 @@
{{- else if (eq $bug_cat "Normalize") -}}
<a href="https://github.com/necolas/normalize.css/issues/{{ $bug_id }}">Normalize #{{ $bug_id }}</a>
{{- end -}}
{{- if (eq $separator true) }}, {{ end -}}
{{- if $has_separator }}, {{ end -}}
{{- else -}}
{{- $word -}}