<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><paragraph><emph><textxml:space="preserve">content</text></emph></paragraph></alert></document>
Other kinds of alerts:
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
>>> [!TIP]
Optional information to help a user be more successful.
>>>
Tip
Optional information to help a user be more successful.
<divclass="markdown-alert markdown-alert-tip"><pclass="markdown-alert-title">Tip</p><p>Optional information to help a user be more successful.</p></div>
> [!TIP]
> Optional information to help a user be more successful.
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="tip"multiline="true"><paragraph><textxml:space="preserve">Optional information to help a user be more successful.</text></paragraph></alert></document>
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
>>> [!IMPORTANT]
Crucial information necessary for users to succeed.
>>>
Important
Crucial information necessary for users to succeed.
<divclass="markdown-alert markdown-alert-important"><pclass="markdown-alert-title">Important</p><p>Crucial information necessary for users to succeed.</p></div>
> [!IMPORTANT]
> Crucial information necessary for users to succeed.
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="important"multiline="true"><paragraph><textxml:space="preserve">Crucial information necessary for users to succeed.</text></paragraph></alert></document>
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
>>> [!WARNING]
Critical content demanding immediate user attention due to potential risks.
>>>
Warning
Critical content demanding immediate user attention due to potential risks.
<divclass="markdown-alert markdown-alert-warning"><pclass="markdown-alert-title">Warning</p><p>Critical content demanding immediate user attention due to potential risks.</p></div>
> [!WARNING]
> Critical content demanding immediate user attention due to potential risks.
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="warning"multiline="true"><paragraph><textxml:space="preserve">Critical content demanding immediate user attention due to potential risks.</text></paragraph></alert></document>
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
>>> [!CAUTION]
Negative potential consequences of an action.
>>>
Caution
Negative potential consequences of an action.
<divclass="markdown-alert markdown-alert-caution"><pclass="markdown-alert-title">Caution</p><p>Negative potential consequences of an action.</p></div>
> [!CAUTION]
> Negative potential consequences of an action.
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="caution"multiline="true"><paragraph><textxml:space="preserve">Negative potential consequences of an action.</text></paragraph></alert></document>
A title can be specified to override the default title:
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
>>> [!NOTE] Pay attention
Highlights information that users should take into account, even when skimming.
>>>
Pay attention
Highlights information that users should take into account, even when skimming.
<divclass="markdown-alert markdown-alert-note"><pclass="markdown-alert-title">Pay attention</p><p>Highlights information that users should take into account, even when skimming.</p></div>
> [!NOTE] Pay attention
> Highlights information that users should take into account, even when skimming.
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"title="Pay attention"multiline="true"><paragraph><textxml:space="preserve">Highlights information that users should take into account, even when skimming.</text></paragraph></alert></document>
Can contain block elements
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><headinglevel="3"><textxml:space="preserve">heading</text></heading><thematic_break/></alert></document>
Ending marker can be longer
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">hello world</text></paragraph></alert><paragraph><textxml:space="preserve">normal</text></paragraph></document>
Nested alerts
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><alerttype="caution"multiline="true"><paragraph><textxml:space="preserve">foo</text></paragraph></alert></alert></document>
Incorrectly nested alerts
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
>>>> [!NOTE]
this block is closed with 5 markers below
>>>>>auto-closed blocks
>>>>>>>>>
Note
this block is closed with 5 markers below
auto-closed blocks
<divclass="markdown-alert markdown-alert-note"><pclass="markdown-alert-title">Note</p><p>this block is closed with 5 markers below</p></div><p>auto-closed blocks</p><blockquote><blockquote></blockquote></blockquote>
> [!NOTE]
> this block is closed with 5 markers below
auto-closed blocks
>>
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">this block is closed with 5 markers below</text></paragraph></alert><paragraph><textxml:space="preserve">auto-closed blocks</text></paragraph><multiline_block_quote><multiline_block_quote/></multiline_block_quote></document>
Marker can be indented up to 3 spaces
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><code_blockxml:space="preserve">>>>
content
>>></code_block></document>
Detection of embedded 4 spaces code block starts in the
column the alert starts, not from the beginning of
the line.
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><code_blockxml:space="preserve">code block
</code_block></alert></document>
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">content</text></paragraph><alerttype="caution"multiline="true"><code_blockxml:space="preserve">code block
</code_block></alert></alert></document>
Closing marker can’t have text on the same line
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">foo</text></paragraph><block_quote><block_quote><block_quote><paragraph><textxml:space="preserve">arg=123</text></paragraph></block_quote></block_quote></block_quote></alert></document>
Alerts self-close at the end of the document
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">foo</text></paragraph></alert></document>
They should terminate paragraphs
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><paragraph><textxml:space="preserve">blah blah</text></paragraph><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">content</text></paragraph></alert></document>
They can be nested in lists
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><listtype="bullet"tight="true"><item><alerttype="note"multiline="true"><listtype="bullet"tight="true"><item><paragraph><textxml:space="preserve">foo</text></paragraph></item></list></alert></item></list></document>
Or in blockquotes
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><block_quote><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">foo</text></paragraph><block_quote><paragraph><textxml:space="preserve">bar</text><softbreak/><textxml:space="preserve">baz</text></paragraph></block_quote></alert></block_quote></document>
List indentation
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
->>> [!NOTE]
foo
bar
>>>
- >>> [!NOTE]
foo
bar
>>>
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><listtype="bullet"tight="false"><item><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">foo</text><softbreak/><textxml:space="preserve">bar</text></paragraph></alert></item><item><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">foo</text><softbreak/><textxml:space="preserve">bar</text></paragraph></alert></item></list></document>
Ignored inside code blocks:
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
$ comrak -e alerts -e multiline-block-quotes -t commonmark -t xml
Some text
>>> [!NOTE]
A quote
>>>
Some other text
Some text
Note
A quote
Some other text
<p>Some text</p><divclass="markdown-alert markdown-alert-note"><pclass="markdown-alert-title">Note</p><p>A quote</p></div><p>Some other text</p>
Some text
> [!NOTE]
> A quote
Some other text
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEdocument SYSTEM "CommonMark.dtd"><documentxmlns="http://commonmark.org/xml/1.0"><paragraph><textxml:space="preserve">Some text</text></paragraph><alerttype="note"multiline="true"><paragraph><textxml:space="preserve">A quote</text></paragraph></alert><paragraph><textxml:space="preserve">Some other text</text></paragraph></document>