# Alerts

Expectations verified against GitHub Markdown API (gh api markdown -f mode=gfm).
Our HTML omits GitHub's SVG icons and uses a `data-alert-type` attribute instead.

## Standard types

```````````````````````````````` example alert
> [!NOTE]
> This is a note
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>This is a note</p>
</div>
````````````````````````````````

```````````````````````````````` example alert
> [!TIP]
> This is a tip
.
<div class="markdown-alert markdown-alert-tip" data-alert-type="tip">
<p class="markdown-alert-title">Tip</p>
<p>This is a tip</p>
</div>
````````````````````````````````

```````````````````````````````` example alert
> [!IMPORTANT]
> This is important
.
<div class="markdown-alert markdown-alert-important" data-alert-type="important">
<p class="markdown-alert-title">Important</p>
<p>This is important</p>
</div>
````````````````````````````````

```````````````````````````````` example alert
> [!WARNING]
> This is a warning
.
<div class="markdown-alert markdown-alert-warning" data-alert-type="warning">
<p class="markdown-alert-title">Warning</p>
<p>This is a warning</p>
</div>
````````````````````````````````

```````````````````````````````` example alert
> [!CAUTION]
> This is a caution
.
<div class="markdown-alert markdown-alert-caution" data-alert-type="caution">
<p class="markdown-alert-title">Caution</p>
<p>This is a caution</p>
</div>
````````````````````````````````

## Case insensitivity

Alert type matching is case-insensitive.

```````````````````````````````` example alert
> [!note]
> Content
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>Content</p>
</div>
````````````````````````````````

```````````````````````````````` example alert
> [!Note]
> Content
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>Content</p>
</div>
````````````````````````````````

## Alert content

Marker alone in first paragraph, blank line, then content:

```````````````````````````````` example alert
> [!NOTE]
>
> Content
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>Content</p>
</div>
````````````````````````````````

Multiple paragraphs:

```````````````````````````````` example alert
> [!NOTE]
> First paragraph
>
> Second paragraph
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>First paragraph</p>
<p>Second paragraph</p>
</div>
````````````````````````````````

Inline formatting:

```````````````````````````````` example alert
> [!TIP]
> This is **bold** and *italic*
.
<div class="markdown-alert markdown-alert-tip" data-alert-type="tip">
<p class="markdown-alert-title">Tip</p>
<p>This is <strong>bold</strong> and <em>italic</em></p>
</div>
````````````````````````````````

Code block inside alert:

```````````````````````````````` example alert
> [!TIP]
> Code:
>
>     function() { }
>
> End
.
<div class="markdown-alert markdown-alert-tip" data-alert-type="tip">
<p class="markdown-alert-title">Tip</p>
<p>Code:</p>
<pre><code>function() { }
</code></pre>
<p>End</p>
</div>
````````````````````````````````

List inside alert:

```````````````````````````````` example alert
> [!IMPORTANT]
> Items:
> - First item
> - Second item
.
<div class="markdown-alert markdown-alert-important" data-alert-type="important">
<p class="markdown-alert-title">Important</p>
<p>Items:</p>
<ul>
<li>First item</li>
<li>Second item</li>
</ul>
</div>
````````````````````````````````

Links inside alert:

```````````````````````````````` example alert
> [!NOTE]
> Check out [this link](https://example.com) for more info
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>Check out <a href="https://example.com">this link</a> for more info</p>
</div>
````````````````````````````````

Heading inside alert:

```````````````````````````````` example alert
> [!IMPORTANT]
> ## Heading
> Content below heading
.
<div class="markdown-alert markdown-alert-important" data-alert-type="important">
<p class="markdown-alert-title">Important</p>
<h2>Heading</h2>
<p>Content below heading</p>
</div>
````````````````````````````````

Empty lines in middle of alert:

```````````````````````````````` example alert
> [!NOTE]
> First
>
>
> After empty lines
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>First</p>
<p>After empty lines</p>
</div>
````````````````````````````````

## Not an alert

Text after marker on the same line:

```````````````````````````````` example alert
> [!NOTE] Some text
.
<blockquote>
<p>[!NOTE] Some text</p>
</blockquote>
````````````````````````````````

Unknown type:

```````````````````````````````` example alert
> [!INVALID]
> Some text
.
<blockquote>
<p>[!INVALID]<br>
Some text</p>
</blockquote>
````````````````````````````````

Unconfigured custom type is not an alert:

```````````````````````````````` example alert
> [!INFO]
> Should be blockquote
.
<blockquote>
<p>[!INFO]<br>
Should be blockquote</p>
</blockquote>
````````````````````````````````

Extra space inside marker:

```````````````````````````````` example alert
> [! NOTE]
> Should be blockquote
.
<blockquote>
<p>[! NOTE]<br>
Should be blockquote</p>
</blockquote>
````````````````````````````````

Missing brackets:

```````````````````````````````` example alert
> !NOTE
> Should be blockquote
.
<blockquote>
<p>!NOTE<br>
Should be blockquote</p>
</blockquote>
````````````````````````````````

Missing exclamation mark:

```````````````````````````````` example alert
> [NOTE]
> Should be blockquote
.
<blockquote>
<p>[NOTE]<br>
Should be blockquote</p>
</blockquote>
````````````````````````````````

Regular blockquote is not affected:

```````````````````````````````` example alert
> This is a regular blockquote
.
<blockquote>
<p>This is a regular blockquote</p>
</blockquote>
````````````````````````````````

## Boundaries

Trailing spaces after marker:

```````````````````````````````` example alert
> [!NOTE]  
> This is a note
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>This is a note</p>
</div>
````````````````````````````````

Trailing tabs after marker:

```````````````````````````````` example alert
> [!WARNING]→→
> Be careful
.
<div class="markdown-alert markdown-alert-warning" data-alert-type="warning">
<p class="markdown-alert-title">Warning</p>
<p>Be careful</p>
</div>
````````````````````````````````

Leading spaces before blockquote marker:

```````````````````````````````` example alert
   > [!IMPORTANT]
   > Content
.
<div class="markdown-alert markdown-alert-important" data-alert-type="important">
<p class="markdown-alert-title">Important</p>
<p>Content</p>
</div>
````````````````````````````````

Alert followed by blockquote:

```````````````````````````````` example alert
> [!NOTE]
> This is an alert

> This is a blockquote
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>This is an alert</p>
</div>
<blockquote>
<p>This is a blockquote</p>
</blockquote>
````````````````````````````````

Adjacent alerts:

```````````````````````````````` example alert
> [!NOTE]
> First alert

> [!WARNING]
> Second alert
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>First alert</p>
</div>
<div class="markdown-alert markdown-alert-warning" data-alert-type="warning">
<p class="markdown-alert-title">Warning</p>
<p>Second alert</p>
</div>
````````````````````````````````

## Nesting and containers

Nested alert inside alert renders as blockquote:

```````````````````````````````` example alert
> [!NOTE]
> This is a note
>> [!WARNING]
>> Nested content
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>This is a note</p>
<blockquote>
<p>[!WARNING]<br>
Nested content</p>
</blockquote>
</div>
````````````````````````````````

Nested blockquote inside alert:

```````````````````````````````` example alert
> [!NOTE]
> This is a note
>> Nested blockquote
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>This is a note</p>
<blockquote>
<p>Nested blockquote</p>
</blockquote>
</div>
````````````````````````````````

Alert inside list item stays as blockquote:

```````````````````````````````` example alert
- > [!NOTE]
  > Test
.
<ul>
<li>
<blockquote>
<p>[!NOTE]<br>
Test</p>
</blockquote>
</li>
</ul>
````````````````````````````````

Alert marker in content is treated as text:

```````````````````````````````` example alert
> [!NOTE]
> This is a note
> [!WARNING]
> This is still part of the note
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>This is a note<br>
[!WARNING]<br>
This is still part of the note</p>
</div>
````````````````````````````````

## Continuation and interruption

Lazy continuation:

```````````````````````````````` example alert
> [!NOTE]
> First line
Lazy continuation
> Continues alert
.
<div class="markdown-alert markdown-alert-note" data-alert-type="note">
<p class="markdown-alert-title">Note</p>
<p>First line<br>
Lazy continuation<br>
Continues alert</p>
</div>
````````````````````````````````

Alert type after regular blockquote content is not an alert:

```````````````````````````````` example alert
> Regular blockquote
> [!NOTE]
> More text
.
<blockquote>
<p>Regular blockquote<br>
[!NOTE]<br>
More text</p>
</blockquote>
````````````````````````````````
