Skip to content

Commit c5c69da

Browse files
committed
Add test for bold and italic formatting inside alert blocks
1 parent 4d9292a commit c5c69da

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/AlertsTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,18 @@ public function testLinksWorkInsideAlert()
236236
$this->assertStringContainsString('<p class="markdown-alert-title">Note</p>', $result);
237237
$this->assertStringContainsString('<p>Visit <a href="/docs">Docs</a>.</p>', $result);
238238
}
239+
240+
public function testBoldAndItalicWorkInsideAlert()
241+
{
242+
$markdown = <<<MARKDOWN
243+
> [!NOTE]
244+
> This is *italic* and **bold** text.
245+
MARKDOWN;
246+
247+
$result = $this->parsedownExtended->text($markdown);
248+
249+
$this->assertStringContainsString('<div class="markdown-alert markdown-alert-note">', $result);
250+
$this->assertStringContainsString('<p class="markdown-alert-title">Note</p>', $result);
251+
$this->assertStringContainsString('<p>This is <em>italic</em> and <strong>bold</strong> text.</p>', $result);
252+
}
239253
}

0 commit comments

Comments
 (0)