Skip to content

Commit

Permalink
Check that the alert candidate is not already in an alert block or ne…
Browse files Browse the repository at this point in the history
…sted within other elements.
  • Loading branch information
snnz committed Jan 2, 2025
1 parent d1233ff commit f2590e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Markdig/Extensions/Alerts/AlertInlineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
// 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;
}
Expand Down

0 comments on commit f2590e7

Please sign in to comment.