Skip to main content

AlertNode

ClassDataClassSource

AlertNode(
children: list[DeletedNode | TextNode | LineBreakNode | HorizontalRuleNode | InlineCodeNode | CodeBlockNode | BoldNode | ItalicNode | UnderlineNode | StrikeNode | SpoilerNode | LinkNode | HeadingNode | ParagraphNode | QuoteNode | AlertNode | ListItemNode | ListNode | TableCellNode | TableRowNode | TableNode],
type: Literal["alert"] = "alert",
title: str = "Caution"
)

Node: Alert

Provide the alert block, representing the following pattern in HTML:

<div class="markdown-alert markdown-alert-caution">
<p class="markdown-alert-title">Caution</p>
...
</div>

which is converted from

> [!CAUTION]
> ...

Sometimes, the class names may differ.

We support this node because it is used for supporting block-style fences like

[spoiler]
...
[/spoiler]

Fields​

NameTypeRequired
Description
childrenlist[DeletedNode | TextNode | LineBreakNode | HorizontalRuleNode | InlineCodeNode | CodeBlockNode | BoldNode | ItalicNode | UnderlineNode | StrikeNode | SpoilerNode | LinkNode | HeadingNode | ParagraphNode | QuoteNode | AlertNode | ListItemNode | ListNode | TableCellNode | TableRowNode | TableNode]The children of the node.
typeLiteral["alert"]The type identifer of this document node.
titlestrThe title of the alert block.