1

Extraire les partiels de calcul du thème 2026

This commit is contained in:
2026-04-04 01:34:49 +02:00
parent 9f381c3e56
commit 5c2235b6bb
6 changed files with 0 additions and 74 deletions

View File

@@ -0,0 +1,19 @@
{{- $raw := printf "%v" . -}}
{{- $trimmed := strings.TrimSpace $raw -}}
{{- $result := dict
"isURL" false
"label" ""
"url" ""
-}}
{{- if gt (len (findRE `(?i)^https?://[^[:space:]]+$` $trimmed)) 0 -}}
{{- $parsedURL := urls.Parse $trimmed -}}
{{- $host := replaceRE `:\d+$` "" $parsedURL.Host -}}
{{- if ne $host "" -}}
{{- $result = dict
"isURL" true
"label" $host
"url" $trimmed
-}}
{{- end -}}
{{- end -}}
{{- return $result -}}