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:
parent
ce8af15ad1
commit
29674b8426
@ -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 -}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user