Debian Codegraph @

src/tests/fixtures/multiline_alerts.md

raw
1 ---
2 title: GitLab Flavored Markdown Spec
3 version: 0.1
4 date: '2023-12-18'
5 license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)'
6 ---
7
8 ## Multi-line Alerts
9
10 Simple container
11
12 ```````````````````````````````` example
13 >>> [!NOTE]
14 *content*
15 >>>
16 .
17 <div class="markdown-alert markdown-alert-note">
18 <p class="markdown-alert-title">Note</p>
19 <p><em>content</em></p>
20 </div>
21 ````````````````````````````````
22
23 Other kinds of alerts:
24
25 ```````````````````````````````` example
26 >>> [!TIP]
27 Optional information to help a user be more successful.
28 >>>
29 .
30 <div class="markdown-alert markdown-alert-tip">
31 <p class="markdown-alert-title">Tip</p>
32 <p>Optional information to help a user be more successful.</p>
33 </div>
34 ````````````````````````````````
35
36 ```````````````````````````````` example
37 >>> [!IMPORTANT]
38 Crucial information necessary for users to succeed.
39 >>>
40 .
41 <div class="markdown-alert markdown-alert-important">
42 <p class="markdown-alert-title">Important</p>
43 <p>Crucial information necessary for users to succeed.</p>
44 </div>
45 ````````````````````````````````
46
47 ```````````````````````````````` example
48 >>> [!WARNING]
49 Critical content demanding immediate user attention due to potential risks.
50 >>>
51 .
52 <div class="markdown-alert markdown-alert-warning">
53 <p class="markdown-alert-title">Warning</p>
54 <p>Critical content demanding immediate user attention due to potential risks.</p>
55 </div>
56 ````````````````````````````````
57
58 ```````````````````````````````` example
59 >>> [!CAUTION]
60 Negative potential consequences of an action.
61 >>>
62 .
63 <div class="markdown-alert markdown-alert-caution">
64 <p class="markdown-alert-title">Caution</p>
65 <p>Negative potential consequences of an action.</p>
66 </div>
67 ````````````````````````````````
68
69 A title can be specified to override the default title:
70
71 ```````````````````````````````` example
72 >>> [!NOTE] Pay attention
73 Highlights information that users should take into account, even when skimming.
74 >>>
75 .
76 <div class="markdown-alert markdown-alert-note">
77 <p class="markdown-alert-title">Pay attention</p>
78 <p>Highlights information that users should take into account, even when skimming.</p>
79 </div>
80 ````````````````````````````````
81
82 Can contain block elements
83
84 ```````````````````````````````` example
85 >>> [!NOTE]
86 ### heading
87
88 -----------
89 >>>
90 .
91 <div class="markdown-alert markdown-alert-note">
92 <p class="markdown-alert-title">Note</p>
93 <h3>heading</h3>
94 <hr />
95 </div>
96 ````````````````````````````````
97
98
99 Ending marker can be longer
100
101 ```````````````````````````````` example
102 >>>>>> [!NOTE]
103 hello world
104 >>>>>>>>>>>
105 normal
106 .
107 <div class="markdown-alert markdown-alert-note">
108 <p class="markdown-alert-title">Note</p>
109 <p>hello world</p>
110 </div>
111 <p>normal</p>
112 ````````````````````````````````
113
114
115 Nested alerts
116
117 ```````````````````````````````` example
118 >>>>> [!NOTE]
119 >>>> [!CAUTION]
120 foo
121 >>>>
122 >>>>>
123 .
124 <div class="markdown-alert markdown-alert-note">
125 <p class="markdown-alert-title">Note</p>
126 <div class="markdown-alert markdown-alert-caution">
127 <p class="markdown-alert-title">Caution</p>
128 <p>foo</p>
129 </div>
130 </div>
131 ````````````````````````````````
132
133 Incorrectly nested alerts
134
135 ```````````````````````````````` example
136 >>>> [!NOTE]
137 this block is closed with 5 markers below
138
139 >>>>>
140
141 auto-closed blocks
142 >>>>>
143 >>>>
144 .
145 <div class="markdown-alert markdown-alert-note">
146 <p class="markdown-alert-title">Note</p>
147 <p>this block is closed with 5 markers below</p>
148 </div>
149 <p>auto-closed blocks</p>
150 <blockquote>
151 <blockquote>
152 </blockquote>
153 </blockquote>
154 ````````````````````````````````
155
156
157 Marker can be indented up to 3 spaces
158
159 ```````````````````````````````` example
160 >>>> [!NOTE]
161 first-level blockquote
162 >>> [!CAUTION]
163 second-level blockquote
164 >>>
165 >>>>
166 regular paragraph
167 .
168 <div class="markdown-alert markdown-alert-note">
169 <p class="markdown-alert-title">Note</p>
170 <p>first-level blockquote</p>
171 <div class="markdown-alert markdown-alert-caution">
172 <p class="markdown-alert-title">Caution</p>
173 <p>second-level blockquote</p>
174 </div>
175 </div>
176 <p>regular paragraph</p>
177 ````````````````````````````````
178
179
180 Fours spaces makes it a code block
181
182 ```````````````````````````````` example
183 >>>
184 content
185 >>>
186 .
187 <pre><code>&gt;&gt;&gt;
188 content
189 &gt;&gt;&gt;
190 </code></pre>
191 ````````````````````````````````
192
193
194 Detection of embedded 4 spaces code block starts in the
195 column the alert starts, not from the beginning of
196 the line.
197
198 ```````````````````````````````` example
199 >>> [!NOTE]
200 code block
201 >>>
202 .
203 <div class="markdown-alert markdown-alert-note">
204 <p class="markdown-alert-title">Note</p>
205 <pre><code>code block
206 </code></pre>
207 </div>
208 ````````````````````````````````
209
210 ```````````````````````````````` example
211 >>>> [!NOTE]
212 content
213 >>> [!CAUTION]
214 code block
215 >>>
216 >>>>
217 .
218 <div class="markdown-alert markdown-alert-note">
219 <p class="markdown-alert-title">Note</p>
220 <p>content</p>
221 <div class="markdown-alert markdown-alert-caution">
222 <p class="markdown-alert-title">Caution</p>
223 <pre><code>code block
224 </code></pre>
225 </div>
226 </div>
227 ````````````````````````````````
228
229 Closing marker can't have text on the same line
230
231 ```````````````````````````````` example
232 >>> [!NOTE]
233 foo
234 >>> arg=123
235 .
236 <div class="markdown-alert markdown-alert-note">
237 <p class="markdown-alert-title">Note</p>
238 <p>foo</p>
239 <blockquote>
240 <blockquote>
241 <blockquote>
242 <p>arg=123</p>
243 </blockquote>
244 </blockquote>
245 </blockquote>
246 </div>
247 ````````````````````````````````
248
249
250 Alerts self-close at the end of the document
251
252 ```````````````````````````````` example
253 >>> [!NOTE]
254 foo
255 .
256 <div class="markdown-alert markdown-alert-note">
257 <p class="markdown-alert-title">Note</p>
258 <p>foo</p>
259 </div>
260 ````````````````````````````````
261
262
263 They should terminate paragraphs
264
265 ```````````````````````````````` example
266 blah blah
267 >>> [!NOTE]
268 content
269 >>>
270 .
271 <p>blah blah</p>
272 <div class="markdown-alert markdown-alert-note">
273 <p class="markdown-alert-title">Note</p>
274 <p>content</p>
275 </div>
276 ````````````````````````````````
277
278
279 They can be nested in lists
280
281 ```````````````````````````````` example
282 - >>> [!NOTE]
283 - foo
284 >>>
285 .
286 <ul>
287 <li>
288 <div class="markdown-alert markdown-alert-note">
289 <p class="markdown-alert-title">Note</p>
290 <ul>
291 <li>foo</li>
292 </ul>
293 </div>
294 </li>
295 </ul>
296 ````````````````````````````````
297
298
299 Or in blockquotes
300
301 ```````````````````````````````` example
302 > >>> [!NOTE]
303 > foo
304 >> bar
305 > baz
306 > >>>
307 .
308 <blockquote>
309 <div class="markdown-alert markdown-alert-note">
310 <p class="markdown-alert-title">Note</p>
311 <p>foo</p>
312 <blockquote>
313 <p>bar
314 baz</p>
315 </blockquote>
316 </div>
317 </blockquote>
318 ````````````````````````````````
319
320
321 List indentation
322
323 ```````````````````````````````` example
324 - >>> [!NOTE]
325 foo
326 bar
327 >>>
328
329 - >>> [!NOTE]
330 foo
331 bar
332 >>>
333 .
334 <ul>
335 <li>
336 <div class="markdown-alert markdown-alert-note">
337 <p class="markdown-alert-title">Note</p>
338 <p>foo
339 bar</p>
340 </div>
341 </li>
342 <li>
343 <div class="markdown-alert markdown-alert-note">
344 <p class="markdown-alert-title">Note</p>
345 <p>foo
346 bar</p>
347 </div>
348 </li>
349 </ul>
350 ````````````````````````````````
351
352
353 Ignored inside code blocks:
354
355 ```````````````````````````````` example
356 ```txt
357 # Code
358 >>> [!NOTE]
359 # Code
360 >>>
361 # Code
362 ```
363 .
364 <pre><code class="language-txt"># Code
365 &gt;&gt;&gt; [!NOTE]
366 # Code
367 &gt;&gt;&gt;
368 # Code
369 </code></pre>
370 ````````````````````````````````
371
372
373 Does not require a leading or trailing blank line
374
375 ```````````````````````````````` example
376 Some text
377 >>> [!NOTE]
378 A quote
379 >>>
380 Some other text
381 .
382 <p>Some text</p>
383 <div class="markdown-alert markdown-alert-note">
384 <p class="markdown-alert-title">Note</p>
385 <p>A quote</p>
386 </div>
387 <p>Some other text</p>
388 ````````````````````````````````