diff --git a/modules/docs/src/Volo.Docs.Web/Areas/Documents/Helpers/TagHelpers/TreeTagHelper.cs b/modules/docs/src/Volo.Docs.Web/Areas/Documents/Helpers/TagHelpers/TreeTagHelper.cs index 07be0cf97d..3657896c67 100644 --- a/modules/docs/src/Volo.Docs.Web/Areas/Documents/Helpers/TagHelpers/TreeTagHelper.cs +++ b/modules/docs/src/Volo.Docs.Web/Areas/Documents/Helpers/TagHelpers/TreeTagHelper.cs @@ -116,6 +116,11 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers private string NormalizePath(string path, bool hasChildItems) { + if (IsExternalLink(path)) + { + return path; + } + var pathWithoutFileExtension = RemoveFileExtensionFromPath(path); if (string.IsNullOrWhiteSpace(path)) @@ -126,6 +131,16 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers return "/documents/" + ProjectName + "/" + Version + "/" + pathWithoutFileExtension; } + protected virtual bool IsExternalLink(string path) + { + if (path.IsNullOrEmpty()) + { + return false; + } + + return path.StartsWith("http") || path.StartsWith("https"); + } + private string RemoveFileExtensionFromPath(string path) { if (path == null) @@ -137,6 +152,5 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers ? path.Left(path.Length - ProjectFormat.Length - 1) : path; } - } }