From f42c452991092537f8dbe34a8677ec009ca5232b Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 8 Jan 2020 15:03:28 +0300 Subject: [PATCH] resolved: MarkdownDocumentToHtmlConverter miscatches the links resolved https://github.com/abpframework/abp/issues/2582 --- .../Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs b/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs index 81ce5ab1f7..5d7282a7e6 100644 --- a/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs +++ b/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs @@ -24,7 +24,7 @@ namespace Volo.Docs.Markdown } private const string MdLinkFormat = "[{0}]({1}{2}/{3}/{4}{5}/{6})"; - private const string MarkdownLinkRegExp = @"\[(.*?)\]\((.*?\.md)\)"; + private const string MarkdownLinkRegExp = @"\[(.*?)\]\((.*?)\)"; private const string AnchorLinkRegExp = @"]+href=\""(.*?)\""[^>]*>(.*)?"; public virtual string Convert(ProjectDto project, DocumentWithDetailsDto document, string version, @@ -56,7 +56,7 @@ namespace Volo.Docs.Markdown var normalized = Regex.Replace(content, MarkdownLinkRegExp, delegate (Match match) { var link = match.Groups[2].Value; - if (UrlHelper.IsExternalLink(link)) + if (UrlHelper.IsExternalLink(link) || !link.EndsWith(".md")) { return match.Value; }