File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 5050 </ button >
5151 </ div >
5252 </ div >
53- {{- highlight $match "scss" "" -}}
53+ {{- $unindent := 0 -}}
54+ {{- $found := false -}}
55+ {{- $first_line:= index (split $match "\n") 0 -}}
56+ {{- range $char := split $first_line "" -}}
57+ {{- if and (eq $char " ") (not $found) -}}
58+ {{- $unindent = add $unindent 1 -}}
59+ {{- else -}}
60+ {{- $found = true -}}
61+ {{- end -}}
62+ {{- end -}}
63+ {{- $output := "" -}}
64+ {{- if (gt $unindent 0) -}}
65+ {{- $prefix := (strings.Repeat $unindent " ") -}}
66+ {{- range $line := split $match "\n" -}}
67+ {{- $line = strings.TrimPrefix $prefix $line -}}
68+ {{ $output = printf "%s%s\n" $output $line }}
69+ {{- end -}}
70+ {{- $output = chomp $output -}}
71+ {{- else -}}
72+ {{- $output = $match -}}
73+ {{- end -}}
74+ {{- highlight $output "scss" "" -}}
5475 </ div >
5576{{- end -}}
You can’t perform that action at this time.
0 commit comments