Skip to content

Commit d87bb72

Browse files
committed
A test has been added.
1 parent f2590e7 commit d87bb72

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/Markdig.Tests/MiscTests.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,4 +317,31 @@ public void RootInlineInTableCellHasCorrectSourceSpan()
317317
Assert.That(paragraph.Inline.Span.Start == paragraph.Inline.FirstChild.Span.Start);
318318
Assert.That(paragraph.Inline.Span.End == paragraph.Inline.LastChild.Span.End);
319319
}
320+
321+
[Test]
322+
public void TestAlertWithinAlertOrNestedBlock()
323+
{
324+
var input = @"
325+
>[!NOTE]
326+
[!NOTE]
327+
The second one is not a note.
328+
329+
>>[!NOTE]
330+
Also not a note.
331+
";
332+
333+
var expected = @"<div class=""markdown-alert markdown-alert-note"">
334+
<p class=""markdown-alert-title""><svg viewBox=""0 0 16 16"" version=""1.1"" width=""16"" height=""16"" aria-hidden=""true""><path d=""M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z""></path></svg>Note</p>
335+
<p>[!NOTE]
336+
The second one is not a note.</p>
337+
</div>
338+
<blockquote>
339+
<blockquote>
340+
<p>[!NOTE]
341+
Also not a note.</p>
342+
</blockquote>
343+
</blockquote>
344+
";
345+
TestParser.TestSpec(input, expected, new MarkdownPipelineBuilder().UseAlertBlocks().Build());
346+
}
320347
}

0 commit comments

Comments
 (0)