Skip to content

Commit 9c1c74e

Browse files
committed
Fix links to localhost
1 parent 7b1c16a commit 9c1c74e

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
@@ -60,7 +60,7 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
6060

6161
if (Uri.TryCreate(url, UriKind.Absolute, out var uri) && uri.Scheme.StartsWith("http"))
6262
{
63-
var baseDomain = string.Join('.', uri.Host.Split('.')[^2..]);
63+
var baseDomain = uri.Host.StartsWith("localhost") ? "localhost" : string.Join('.', uri.Host.Split('.')[^2..]);
6464
if (!context.Configuration.ExternalLinkHosts.Contains(baseDomain))
6565
{
6666
processor.EmitWarning(

0 commit comments

Comments
 (0)