Skip to content

Commit 6162b10

Browse files
reakaleekMpdreamz
andauthored
Fix root links (#382)
* Fix root links * Fix * Update src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs Co-authored-by: Martijn Laarman <[email protected]> * Update src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs --------- Co-authored-by: Martijn Laarman <[email protected]>
1 parent b51d311 commit 6162b10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
151151
// rooted links might need the configured path prefix to properly link
152152
var prefix = processor.GetBuildContext().UrlPathPrefix;
153153
if (url.StartsWith("/") && !string.IsNullOrWhiteSpace(prefix))
154-
link.Url = $"{prefix}/{link.Url}";
154+
link.Url = $"{prefix.TrimEnd('/')}/{link.Url}";
155155

156156
if (!string.IsNullOrEmpty(anchor))
157157
link.Url += $"#{anchor}";

0 commit comments

Comments
 (0)