mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-23 21:53:25 +02:00
Simplify bugify.html (#33063)
* use `in` instead of `strings.Contains` since the latter is not documented * use `cond`
This commit is contained in:
@@ -1,12 +1,8 @@
|
|||||||
{{- $words := (split . " ") -}}
|
{{- $words := split . " " -}}
|
||||||
|
|
||||||
{{- range $word := $words -}}
|
{{- range $word := $words -}}
|
||||||
{{- if (strings.Contains $word "#") -}}
|
{{- if (in $word "#") -}}
|
||||||
{{- $separator := false -}}
|
{{- $has_separator := cond (in $word ",") true false -}}
|
||||||
|
|
||||||
{{- if (strings.Contains $word ",") -}}
|
|
||||||
{{- $separator = true -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- $data := split $word "#" -}}
|
{{- $data := split $word "#" -}}
|
||||||
{{- $bug_cat := replace (index $data 0) "\n" "" -}}
|
{{- $bug_cat := replace (index $data 0) "\n" "" -}}
|
||||||
@@ -32,7 +28,7 @@
|
|||||||
{{- else if (eq $bug_cat "Normalize") -}}
|
{{- else if (eq $bug_cat "Normalize") -}}
|
||||||
<a href="https://github.com/necolas/normalize.css/issues/{{ $bug_id }}">Normalize #{{ $bug_id }}</a>
|
<a href="https://github.com/necolas/normalize.css/issues/{{ $bug_id }}">Normalize #{{ $bug_id }}</a>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if (eq $separator true) }}, {{ end -}}
|
{{- if $has_separator }}, {{ end -}}
|
||||||
|
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $word -}}
|
{{- $word -}}
|
||||||
|
Reference in New Issue
Block a user