Upstream xoofx/markdig state of the touched files before baa95a9ca3

This commit is contained in:
upstream committed 2026-09-19 11:41:48 +02:00
1 parent cf9456728c
commit 40eebc0cd8
5 files changed
+89 -74

No files matched your search

@@ -150,14 +150,6 @@ public class LinkInlineParser : InlineParser
return false;
}
// Implicitly generated reference definitions (e.g. automatic heading anchors from the auto-identifier
// extension) must not hijack a bracket pair nested inside another still-open link, otherwise they would
// silently break the outer, explicitly authored link (see https://github.com/xoofx/markdig/issues/668).
if (!linkRef.AllowResolutionInsideOpenLink && HasActiveAncestorLink(parent))
{
return false;
}
Inline? link = null;
// Try to use a callback directly defined on the LinkReferenceDefinition
if (linkRef.CreateLinkInline != null)
@@ -438,24 +430,6 @@ public class LinkInlineParser : InlineParser
}
}
/// <summary>
/// Determines whether the given link delimiter is nested inside another link/image delimiter that is
/// still active, i.e. it may still be resolved into a real link/image once fully parsed.
/// </summary>
private static bool HasActiveAncestorLink(LinkDelimiterInline delimiter)
{
var inline = delimiter.Parent;
while (inline != null)
{
if (inline is LinkDelimiterInline { IsActive: true })
{
return true;
}
inline = inline.Parent;
}
return false;
}
private static void MarkParentAsInactive(Inline? inline)
{
while (inline != null)