in src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs [256:280]
private static void ProcessLinkText(InlineProcessor processor, LinkInline link, MarkdownFile? markdown, string? anchor, string url, IFileInfo file)
{
if (link.FirstChild != null && string.IsNullOrEmpty(anchor))
return;
if (markdown is null && link.FirstChild == null)
{
processor.EmitWarning(link,
$"'{url}' could not be resolved to a markdown file while creating an auto text link, '{file.FullName}' does not exist.");
return;
}
var title = markdown?.Title;
if (!string.IsNullOrEmpty(anchor))
{
if (markdown is not null)
ValidateAnchor(processor, markdown, anchor, link);
if (link.FirstChild == null && (markdown?.PageTableOfContent.TryGetValue(anchor, out var heading) ?? false))
title += " > " + heading.Heading;
}
if (link.FirstChild == null && !string.IsNullOrEmpty(title))
_ = link.AppendChild(new LiteralInline(title));
}