Skip to content

Commit f2590e7

Browse files
committed
Check that the alert candidate is not already in an alert block or nested within other elements.
1 parent d1233ff commit f2590e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Markdig/Extensions/Alerts/AlertInlineParser.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
2929
// We expect the alert to be the first child of a quote block. Example:
3030
// > [!NOTE]
3131
// > This is a note
32-
if (processor.Block is not ParagraphBlock paragraphBlock || paragraphBlock.Parent is not QuoteBlock quoteBlock || paragraphBlock.Inline?.FirstChild != null)
32+
if (processor.Block is not ParagraphBlock paragraphBlock || paragraphBlock.Parent is not QuoteBlock quoteBlock || paragraphBlock.Inline?.FirstChild != null
33+
|| quoteBlock is AlertBlock || quoteBlock.Parent is not MarkdownDocument)
3334
{
3435
return false;
3536
}

0 commit comments

Comments
 (0)