Skip to content

Commit 9b44e21

Browse files
committed
Add a sentence on how to fix the external URI warning
1 parent 99ae294 commit 9b44e21

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
6262
{
6363
var baseDomain = string.Join('.', uri.Host.Split('.')[^2..]);
6464
if (!context.Configuration.ExternalLinkHosts.Contains(baseDomain))
65-
processor.EmitWarning(line, column, length, $"external URI: {uri} ");
65+
{
66+
processor.EmitWarning(
67+
line,
68+
column,
69+
length,
70+
$"External URI '{uri}' is not allowed. Add '{baseDomain}' to the " +
71+
$"'external_hosts' list in {context.Configuration.SourceFile} to " +
72+
"allow links to this domain.");
73+
}
6674
return match;
6775
}
6876

0 commit comments

Comments
 (0)