Check that the alert candidate is not already in an alert block or nested within other elements.

This commit is contained in:
Sergey Nozhenko
2025-01-03 01:27:11 +03:00
parent d1233ffe66
commit f2590e7b80

View File

@@ -29,7 +29,8 @@ public class AlertInlineParser : InlineParser
// We expect the alert to be the first child of a quote block. Example:
// > [!NOTE]
// > This is a note
if (processor.Block is not ParagraphBlock paragraphBlock || paragraphBlock.Parent is not QuoteBlock quoteBlock || paragraphBlock.Inline?.FirstChild != null)
if (processor.Block is not ParagraphBlock paragraphBlock || paragraphBlock.Parent is not QuoteBlock quoteBlock || paragraphBlock.Inline?.FirstChild != null
|| quoteBlock is AlertBlock || quoteBlock.Parent is not MarkdownDocument)
{
return false;
}