Merge pull request #18330 from dvdksn/main

fix: use links with leading slash as-is
This commit is contained in:
Sebastiaan van Stijn 2023-09-30 11:17:42 +02:00 committed by GitHub
commit 1b176a0a6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -12,8 +12,8 @@
></a
>
{{- else if (strings.HasPrefix $url "/") -}}
{{/* absolute link, use absURL */}}
<a class="link" href="{{ absURL $url }}">{{ .Text | safeHTML }}</a>
{{/* absolute link, use url as-is */}}
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
{{- else -}}
{{/* check if the file links to index.md */}}
{{- if (strings.FindRE `([^_]|^)index.md` $url 1) -}}