diff --git a/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs b/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs index b69f82ee9..f24dc9fd8 100644 --- a/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs +++ b/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs @@ -151,7 +151,7 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice) // rooted links might need the configured path prefix to properly link var prefix = processor.GetBuildContext().UrlPathPrefix; if (url.StartsWith("/") && !string.IsNullOrWhiteSpace(prefix)) - link.Url = $"{prefix}/{link.Url}"; + link.Url = $"{prefix.TrimEnd('/')}/{link.Url}"; if (!string.IsNullOrEmpty(anchor)) link.Url += $"#{anchor}";