Simplify and align detection of remote links
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{{- $destination := .Destination -}}
|
||||
{{- $url := urls.Parse .Destination -}}
|
||||
|
||||
{{- $isRemote := gt (len $url.Host) 0 -}}
|
||||
{{- $isRemote := $url.IsAbs -}}
|
||||
{{- $isFragment := strings.HasPrefix .Destination "#" -}}
|
||||
|
||||
{{- if and (not $isRemote) (not $isFragment) -}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{- $destination := .Destination -}}
|
||||
{{- $url := urls.Parse .Destination -}}
|
||||
|
||||
{{- $isRemote := gt (len $url.Host) 0 -}}
|
||||
{{- $isRemote := $url.IsAbs -}}
|
||||
{{- $isFragment := strings.HasPrefix .Destination "#" -}}
|
||||
|
||||
{{- if and (not $isRemote) (not $isFragment) -}}
|
||||
|
||||
Reference in New Issue
Block a user