File: asciidoc.xml

package info (click to toggle)
kf6-syntax-highlighting 6.20.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,872 kB
  • sloc: xml: 205,656; cpp: 12,882; python: 3,055; sh: 965; perl: 814; ruby: 494; pascal: 393; javascript: 161; php: 150; jsp: 132; lisp: 131; haskell: 124; ada: 119; ansic: 107; makefile: 96; f90: 94; ml: 85; cobol: 81; yacc: 71; csh: 62; exp: 61; erlang: 54; sql: 51; java: 47; sed: 45; objc: 37; tcl: 36; awk: 31; asm: 30; fortran: 18; cs: 10
file content (640 lines) | stat: -rw-r--r-- 37,998 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language [
    <!-- alphabetic -->
    <!ENTITY alp "a-zA-Z">
    <!-- alphanumeric -->
    <!ENTITY aln "&alp;0-9">
    <!ENTITY id "\w[\w-]+">
    <!-- percent symbol, needs to be encoded inside an entity definition -->
    <!ENTITY perc "&#x0025;">

    <!ENTITY admonition_names "CAUTION|IMPORTANT|NOTE|TIP|WARNING">

    <!-- regular expression parts to identify anchors -->
    <!ENTITY anchor_mid "&id;(?:,.+?)?">
    <!ENTITY anchor_phrase "#\S(?:.*?\S)?#">

    <!-- block delimiters -->
    <!ENTITY block_dels_comment "/{4,}">
    <!ENTITY block_dels_normal "={4,}|_{4,}|\*{4,}|-{2}|&quot;{2}">
    <!ENTITY block_dels_pass "\+{4,}">
    <!ENTITY block_dels_verbatim "`{3}|-{4,}|\.{4,}">
    <!-- postfix/trailing part of block name -->
    <!ENTITY block_name_post "(?:[#&perc;].+)?\s*(?:,.*)?\]\s*$">
    <!-- block end delimiter, dynamic matching: "^%1\s*$" -->
    <!ENTITY block_end_del "^&perc;1\s*$">

    <!-- unicode character reference, decimal and hexadecimal -->
    <!ENTITY char_ref "&amp;#(?:\d{2,4}|x[\da-fA-F]{2,4});">

    <!-- email - inline -->
    <!ENTITY email "\w[\w.&perc;+-]*@[&aln;][&aln;.-]*\.[&alp;]{2,4}\b">

    <!-- link macro and mailto: -->
    <!ENTITY link_mailto "(?:link|mailto):[^:\s\[][^\s\[]*\[(?:\]|.*?[^\\]\])">

    <!-- macro -->
    <!ENTITY macro "(?:anchor|xref):&id;\[.*?\]|(?:btn|footnote(?:ref)?|kbd):\[.*?\]|pass:\w*\[.*?\]|(?:icon|image|menu):[^:].*?\[.*?\]|toc::\[\]">

    <!ENTITY list_marker "(?:\S.+::(?=\s|$)|(?:(?:\.+|\d+\.)|(?:-|\*+)(?:\s+\[[*x ]\])?)(?=\s+\S))">

    <!ENTITY table_option_delimiter "(?:(?:\d*\.)?\d+\+|\d+\*)?(?:[&lt;&gt;^]?\.?[&lt;&gt;^])?[adehlmsv]?\|">

    <!-- parts to build regular expressions to identify quoted (formatted) text
         E.g. emphasized, marked, strong. -->
    <!-- prefix/leading part -->
    <!ENTITY quoted_pre "(?&lt;=^|[^\w;:}])">
    <!ENTITY quoted_pre_pass "(?&lt;=^|\W)">
    <!-- central part -->
    <!ENTITY quoted "\S(?:.*?\S)??">
    <!-- postfix/trailing part -->
    <!ENTITY quoted_post "(?=\W|$)">
]>
<language author="Andreas Gratzer" extensions="*.ad;*.adoc;*.asciidoc" kateversion="5.0" mimetype="text/asciidoc" name="AsciiDoc" license="MIT" section="Markup" version="9">
    <highlighting>
        <list name="macro">
            <item>anchor</item>
            <item>btn</item>
            <item>footnote</item>
            <item>footnoteref</item>
            <item>icon</item>
            <item>image</item>
            <item>indexterm</item>
            <item>indexterm2</item>
            <item>kbd</item>
            <item>menu</item>
            <item>pass</item>
            <item>toc</item>
            <item>xref</item>
        </list>

        <contexts>
            <context name="start" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
                <!-- section title level 0 to 5 -->
                <RegExpr String="^(?:={1,6}|#{1,6})\s+(?=\S)" lookAhead="1" context="dispatch section main title" column="0"/>
                <IncludeRules context="R section inline"/>
            </context>

            <!-- attribute value definition, may span multiple lines -->
            <context name="attribute value" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
                <!-- line with continuation -->
                <RegExpr String=".*?(?=\s+(?:\+\s+)?\\\s*$)" attribute="Attribute Value" context="continuation"/>
                <!-- line without continuation, terminates value definition -->
                <RegExpr String=".*" attribute="Attribute Value" context="#pop"/>
            </context>
            <!-- inline attribute value definition -->
            <context name="attribute value inline" attribute="Attribute Value" lineEndContext="#stay">
                <!-- the leading `:` is part of the definition syntax and should not be highlighted as value -->
                <DetectChar char=":" attribute="Attribute" context="attribute value inline L2"/>
                <DetectChar char="}" attribute="Attribute" context="#pop"/>
            </context>
            <context name="attribute value inline L2" attribute="Attribute Value" lineEndContext="#stay">
                <DetectChar char="}" attribute="Attribute" context="#pop#pop"/>
            </context>

            <!-- backlash, may function as an escape -->
            <context name="backlash" attribute="Normal" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
                <!-- attribute usage
                     formatted/quoted text
                     replacement of apostrophe
                     table separator (default)
                     anchor, consuming leading char will make anchor matches fail
                     cross reference
                     indexterm, consuming leading char will make matches fail
                -->
                <!-- replacement (besides apostrophe -->
                <Detect2Chars char="&lt;" char1="-" attribute="Normal" context="#pop"/>
                <Detect2Chars char="&lt;" char1="=" attribute="Normal" context="#pop"/>
                <AnyChar String="_#`+*~^'|{[&lt;(" attribute="Normal" context="#pop"/>
                <Detect2Chars char="-" char1="-" attribute="Normal" context="#pop"/>
                <Detect2Chars char="-" char1="&gt;" attribute="Normal" context="#pop"/>
                <Detect2Chars char="=" char1="&gt;" attribute="Normal" context="#pop"/>
                <StringDetect String="..." attribute="Normal" context="#pop"/>
                <!-- email - inline, needs to be ordered after mailto: -->
                <!-- link and mailto macros, note that ftp, irc, http(s) don't match with leading `\` anyway -->
                <RegExpr String="&email;|&link_mailto;|&char_ref;" attribute="Normal" context="#pop"/>
                <!-- macro -->
                <keyword String="macro" attribute="Normal" context="#pop"/>
            </context>

            <context name="block title" attribute="Block Title" lineEndContext="#pop">
                <IncludeRules context="R title"/>
            </context>

            <context name="comment" attribute="Comment" lineEndContext="#stay" lineEmptyContext="#pop">
                <DetectSpaces attribute="Comment"/>
                <RegExpr String="^(&block_dels_comment;)\s*$" attribute="Comment" context="#pop!comment delimited" beginRegion="comment" column="0"/>
                <IncludeRules context="R anchor"/>
                <IncludeRules context="R block title"/>
                <IncludeRules context="##Comments"/>
                <DetectIdentifier attribute="Comment"/>
            </context>
            <context name="comment delimited" attribute="Comment" lineEndContext="#stay">
                <DetectSpaces attribute="Comment"/>
                <RegExpr String="&block_end_del;" dynamic="true" attribute="Comment" context="#pop" endRegion="comment" column="0"/>
                <IncludeRules context="##Comments" />
                <DetectIdentifier attribute="Comment"/>
            </context>
            <context name="comment single-line" attribute="Comment" lineEndContext="#pop">
                <DetectSpaces attribute="Comment"/>
                <IncludeRules context="##Comments" />
                <DetectIdentifier attribute="Comment"/>
            </context>

            <!-- continuation, both for normal text and attribute value definition
                 The allowed pattern must already by validated.
                 Here only the possible characters are highlighted. -->
            <context name="continuation" attribute="Normal" lineEndContext="#pop">
                <AnyChar String="+\" attribute="Control"/>
            </context>

            <context name="main title" attribute="Main Title" lineEndContext="#pop!section L0">
                <IncludeRules context="R title"/>
            </context>

            <context name="normal" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
                <RegExpr String="^(-{2}|&block_dels_normal;)\s*$" attribute="Delimiter" context="#pop!normal delimited" beginRegion="block" column="0"/>
                <IncludeRules context="R block title"/>
                <!-- shared rules includes anchor rules, so we do not need to include that separately -->
                <IncludeRules context="R shared"/>
                <IncludeRules context="R normal"/>
            </context>
            <context name="normal delimited" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="&block_end_del;" dynamic="true" attribute="Delimiter" context="#pop" endRegion="block" column="0"/>
                <IncludeRules context="R admonition"/>
                <IncludeRules context="R block"/>
                <!-- shared rules includes anchor rules, so we do not need to include that separately -->
                <IncludeRules context="R shared"/>
                <IncludeRules context="R normal"/>
            </context>

            <context name="passthrough" attribute="Passthrough" lineEndContext="#stay" lineEmptyContext="#pop">
                <DetectSpaces attribute="Passthrough"/>
                <IncludeRules context="R include"/>
                <DetectIdentifier attribute="Passthrough"/>
                <RegExpr String="^(&block_dels_pass;)\s*$" attribute="Delimiter" context="#pop!passthrough delimited" beginRegion="block" column="0"/>
                <IncludeRules context="R anchor"/>
                <IncludeRules context="R block title"/>
            </context>
            <context name="passthrough delimited" attribute="Passthrough" lineEndContext="#stay">
                <RegExpr String="&block_end_del;" dynamic="true" attribute="Delimiter" context="#pop" endRegion="block" column="0"/>
                <IncludeRules context="R include"/>
            </context>

            <context name="dispatch section main title" attribute="Normal" lineEndContext="#stay">
                <IncludeRules context="dispatch section title L1-5"/>
                <!-- main title, first level 0 section title -->
                <AnyChar String="=#" attribute="Main Title" context="#pop!main title" beginRegion="section" column="0"/>
            </context>

            <context name="dispatch section title L0-5" attribute="Normal" lineEndContext="#stay">
                <IncludeRules context="dispatch section title L1-5"/>
                <AnyChar String="=#" attribute="Section Title" context="#pop!section title L0" beginRegion="section" endRegion="section" column="0"/>
            </context>
            <context name="dispatch section title L1-5" attribute="Normal" lineEndContext="#stay">
                <IncludeRules context="dispatch section title L2-5"/>
                <Detect2Chars char="=" char1="=" attribute="Section Title" context="#pop!section title L1" beginRegion="section" column="0"/>
                <Detect2Chars char="#" char1="#" attribute="Section Title" context="#pop!section title L1" beginRegion="section" column="0"/>
            </context>
            <context name="dispatch section title L2-5" attribute="Normal" lineEndContext="#stay">
                <IncludeRules context="dispatch section title L3-5"/>
                <StringDetect String="===" attribute="Section Title" context="#pop!section title L2" beginRegion="section" column="0"/>
                <StringDetect String="###" attribute="Section Title" context="#pop!section title L2" beginRegion="section" column="0"/>
            </context>
            <context name="dispatch section title L3-5" attribute="Normal" lineEndContext="#stay">
                <IncludeRules context="dispatch section title L4-5"/>
                <StringDetect String="====" attribute="Section Title" context="#pop!section title L3" beginRegion="section" column="0"/>
                <StringDetect String="####" attribute="Section Title" context="#pop!section title L3" beginRegion="section" column="0"/>
            </context>
            <context name="dispatch section title L4-5" attribute="Normal" lineEndContext="#stay">
                <IncludeRules context="dispatch section title L5"/>
                <StringDetect String="=====" attribute="Section Title" context="#pop!section title L4" beginRegion="section" column="0"/>
                <StringDetect String="#####" attribute="Section Title" context="#pop!section title L4" beginRegion="section" column="0"/>
            </context>
            <context name="dispatch section title L5" attribute="Normal" lineEndContext="#stay">
                <StringDetect String="======" attribute="Section Title" context="#pop!section title L5" beginRegion="section" column="0"/>
                <StringDetect String="######" attribute="Section Title" context="#pop!section title L5" beginRegion="section" column="0"/>
            </context>

            <context name="section L0" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
                <RegExpr String="^(?:={1,6}|#{1,6})\s+(?=\S)" lookAhead="1" context="dispatch section title L0-5" column="0"/>
                <IncludeRules context="section L5"/>
            </context>

            <context name="section L1" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
                <RegExpr String="^(?:={3,6}|#{3,6})\s+(?=\S)" lookAhead="1" context="dispatch section title L2-5" column="0"/>
                <IncludeRules context="section L5"/>
            </context>

            <context name="section L2" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
                <RegExpr String="^(?:={4,6}|#{4,6})\s+(?=\S)" lookAhead="1" context="dispatch section title L3-5" column="0"/>
                <IncludeRules context="section L5"/>
            </context>

            <context name="section L3" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
                <RegExpr String="^(?:={5,6}|#{5,6})\s+(?=\S)" lookAhead="1" context="dispatch section title L4-5" column="0"/>
                <IncludeRules context="section L5"/>
            </context>

            <context name="section L4" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
                <RegExpr String="^(?:={6}|#{6})\s+(?=\S)" lookAhead="1" context="dispatch section title L5" column="0"/>
                <IncludeRules context="section L5"/>
            </context>

            <context name="section L5" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
                <RegExpr String="^(?:={1,6}|#{1,6})\s+\S" lookAhead="1" context="#pop" endRegion="section" column="0"/>
                <IncludeRules context="R section inline"/>
            </context>

            <context name="section title L0" attribute="Section Title" lineEndContext="#pop">
                <IncludeRules context="R title"/>
            </context>

            <context name="section title L1" attribute="Section Title" lineEndContext="#pop!section L1">
                <IncludeRules context="R title"/>
            </context>

            <context name="section title L2" attribute="Section Title" lineEndContext="#pop!section L2">
                <IncludeRules context="R title"/>
            </context>

            <context name="section title L3" attribute="Section Title" lineEndContext="#pop!section L3">
                <IncludeRules context="R title"/>
            </context>

            <context name="section title L4" attribute="Section Title" lineEndContext="#pop!section L4">
                <IncludeRules context="R title"/>
            </context>

            <context name="section title L5" attribute="Section Title" lineEndContext="#pop!section L5">
                <IncludeRules context="R title"/>
            </context>

            <context name="table" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="&block_end_del;" dynamic="true" attribute="Delimiter" context="#pop" endRegion="block" column="0"/>
                <!-- `|` with prefix for alignment, style etc. -->
                <RegExpr String="(?&lt;=^|\s)&table_option_delimiter;" attribute="Delimiter"/>
                <!-- simple `|` without alignment, style etc. -->
                <DetectChar char="|" attribute="Delimiter"/>
                <IncludeRules context="R shared"/>
                <IncludeRules context="R normal"/>
            </context>

            <context name="verbatim" attribute="Verbatim" lineEndContext="#stay">
                <RegExpr String="^(-{2}|&block_dels_verbatim;)\s*$" attribute="Delimiter" context="#pop!verbatim delimited" beginRegion="block" column="0"/>
                <IncludeRules context="R anchor"/>
                <RegExpr String="^(\[\w+[^,\]]*(,[^,\]]*)*\]\s*)+$" attribute="Preprocessor" column="0"/>
                <IncludeRules context="R block title"/>
                <IncludeRules context="R comment"/>
                <IncludeRules context="R include"/>
                <RegExpr String="^.*" attribute="Verbatim" context="#pop!verbatim paragraph" column="0"/>
            </context>
            <context name="verbatim delimited" attribute="Verbatim" lineEndContext="#stay">
                <RegExpr String="&block_end_del;" dynamic="true" attribute="Delimiter" context="#pop" endRegion="block" column="0"/>
                <IncludeRules context="R include"/>
            </context>
            <context name="verbatim paragraph" attribute="Verbatim" lineEndContext="#stay" lineEmptyContext="#pop">
                <IncludeRules context="R include"/>
            </context>

            <!-- contexts to be used for IncludeRules only -->

            <context name="R normal" attribute="Normal" lineEndContext="#stay">
                <!-- Regex which allows to quickly consume text that is not
                    - macro
                    - continuation
                    - index term
                    - link
                    - replacement
                    - preprocessor
                    - formatted text
                    - table delimiter

                maanchor:anchor-id[Macro Anchor]
                ^ Normal
                  ^ Macro

                bla__bla__bla
                ^ Normal
                   ^ Emphasized
                          ^ Normal

                For some reason, Asciidoctor recognizes emails with leading : or / but does not render them as link

                /example@mail.com
                ^ Normal

                example@mail.com
                ^ Link
                -->
                <RegExpr String="([:/]&email;|(?!&macro;|link:|mailto:|(?:ftp|https?|irc)://|&char_ref;|indexterm2?:\[.+?\]|[\\+|\[{~^]|__|##|\([CR]\)|\(TM\)|\.\.\.|&lt;[-=&lt;]|--|->|=>|``\*?_?|\*\*_?|\(\(|\s+[[+]|\s&table_option_delimiter;|(?&lt;=[^&alp;;:}])_|&quoted_pre;(`\*?_?|\*_?|#)|(?&lt;=[&alp;])'(?=[&alp;])|&email;).)++" attribute="Normal"/>
            </context>

            <context name="R admonition" attribute="Normal" lineEndContext="#stay">
                <!-- admonition - simple form, block form is part of block rules -->
                <RegExpr String="^(?:&admonition_names;):(?=\s+\S)" attribute="Preprocessor" context="normal" column="0"/>
            </context>

            <context name="R anchor" attribute="Normal" lineEndContext="#stay">
                <!-- shorthand form at line start -->
                <!-- bibliographic anchor -->
                <!-- normal form -->
                <!-- shorthand form inline -->
                <RegExpr String="^\[#&anchor_mid;\](?:&anchor_phrase;|\s*$)|\[{3}&anchor_mid;\]{3}|\[{2}&anchor_mid;\]{2}|(?&lt;=\S\s)\s*\[\s*#&anchor_mid;\s*\]&anchor_phrase;" attribute="Anchor"/>
            </context>

            <context name="R attribute" attribute="Normal" lineEndContext="#stay">
                <!-- attribute definition without value / unset attribute -->
                <RegExpr String="^:!?&id;!?:$" attribute="Attribute" column="0"/>
                <!-- attribute definition with value -->
                <RegExpr String="^:!?&id;!?:\s(?=\S)" attribute="Attribute" context="attribute value" column="0"/>
                <!-- attribute inline definition -->
                <RegExpr String="\{set:&id;(?=(?::.*)?\})" minimal="true" attribute="Attribute" context="attribute value inline"/>
                <IncludeRules context="R attribute usage"/>
            </context>

            <context name="R attribute usage" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="\{&id;\}" attribute="Attribute"/>
            </context>

            <context name="R block" attribute="Normal" lineEndContext="#stay">
                <IncludeRules context="R block title"/>
                <IncludeRules context="R block without title"/>
            </context>

            <context name="R block without title" attribute="Normal" lineEndContext="#stay">
                <!-- name matching -->
                <RegExpr String="^\[(?:&admonition_names;)&block_name_post;|^\[(?:example|quote|sidebar|verse)&block_name_post;" attribute="Preprocessor" context="normal" column="0"/>
                <RegExpr String="^\[(?:pass|stem)&block_name_post;" attribute="Preprocessor" context="passthrough" column="0"/>
                <RegExpr String="^\[(?:listing|literal|source)&block_name_post;" attribute="Preprocessor" context="verbatim" column="0"/>

                <!-- delimiter matching -->
                <RegExpr String="^(&block_dels_normal;)\s*$" attribute="Delimiter" context="normal delimited" beginRegion="block" column="0"/>
                <RegExpr String="^(&block_dels_pass;)\s*$" attribute="Delimiter" context="passthrough delimited" beginRegion="block" column="0"/>
                <RegExpr String="^(\|={3,})\s*$" attribute="Delimiter" context="table" beginRegion="block" column="0"/>
                <RegExpr String="^(&block_dels_verbatim;)\s*$" attribute="Delimiter" context="verbatim delimited" beginRegion="block" column="0"/>
            </context>

            <context name="R block title" attribute="Normal" lineEndContext="#stay">
                <!-- not more than 3 leading dots followed by a non-dot, otherwise it would conflict with the delimited literal block -->
                <RegExpr String="^\.{1,3}(?=[^\.\s])" attribute="Block Title" context="block title" column="0"/>
            </context>

            <context name="R comment" attribute="Normal" lineEndContext="#stay">
                <!-- comment - multi-line, named block -->
                <RegExpr String="^\[comment&block_name_post;" attribute="Preprocessor" context="comment" column="0"/>
                <!-- comment - multi-line, delimited block -->
                <RegExpr String="^(&block_dels_comment;)\s*$" attribute="Comment" context="comment delimited" beginRegion="comment" column="0"/>
                <!-- comment - single line -->
                <RegExpr String="^/{2}(?:[^/]|$)" attribute="Comment" context="comment single-line" column="0"/>
            </context>

            <context name="R formatted" attribute="Normal" lineEndContext="#stay">
                <!-- custom style, e.g. [underline]#underlined text# -->
                <RegExpr String="(?&lt;=^|\W)\[[^\]]+?\]([#_`*]{1,2})&quoted;\g1&quoted_post;" attribute="Preprocessor"/>

                <!-- combined highlighting must be ordered before simple highlighting -->

                <!-- emphasized monospaced strong unconstrained - must be ordered before constrained -->
                <!-- emphasized monospaced strong - constrained must be ordered after unconstrained -->
                <RegExpr String="`{2}\*_.*?_\*`{2}|&quoted_pre;`\*_&quoted;_\*`&quoted_post;" attribute="Emphasized Monospaced Strong"/>

                <!-- emphasized strong unconstrained - must be ordered before constrained -->
                <!-- emphasized strong constrained - must be ordered after unconstrained -->
                <RegExpr String="\*{2}_.*?_\*{2}|&quoted_pre;\*_&quoted;_\*&quoted_post;" attribute="Emphasized Strong"/>

                <!-- monospaced strong unconstrained - must be ordered before constrained -->
                <!-- monospaced strong constrained - must be ordered after unconstrained -->
                <RegExpr String="`{2}\*.*?\*`{2}|&quoted_pre;`\*&quoted;\*`&quoted_post;" attribute="Monospaced Strong"/>

                <!-- emphasized monospaced unconstrained - must be ordered before constrained -->
                <!-- emphasized monospaced constrained - must be ordered after unconstrained -->
                <RegExpr String="`{2}_.*?_`{2}|&quoted_pre;`_&quoted;_`&quoted_post;" attribute="Emphasized Monospaced"/>

                <!-- strong unconstrained - must be ordered before constrained -->
                <!-- strong constrained - must be ordered after unconstrained -->
                <RegExpr String="\*{2}[^*].*?\*{2}|&quoted_pre;\*&quoted;\*&quoted_post;" attribute="Strong"/>

                <!-- emphasized unconstrained - must be ordered before constrained -->
                <!-- emphasized constrained - must be ordered after unconstrained
                     Can't use &quoted_pre; as that excludes \w which excludes `_` too. -->
                <RegExpr String="_{2}[^_].*?_{2}|(?&lt;=^|[^&alp;;:}])_&quoted;_&quoted_post;" attribute="Emphasized"/>

                <IncludeRules context="R marked"/>
                <IncludeRules context="R monospaced"/>

                <!-- subscript -->
                <RegExpr String="~\S+~" minimal="true" attribute="Subscript"/>
                <!-- superscript -->
                <RegExpr String="\^\S+\^" minimal="true" attribute="Superscript"/>
            </context>

            <context name="R include" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="^include::.*\[.*?\](?=\s*$)" attribute="Preprocessor" column="0"/>
            </context>

            <context name="R macro" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="&macro;" attribute="Preprocessor"/>
            </context>

            <context name="R marked" attribute="Normal" lineEndContext="#stay">
                <!-- marked unconstrained - must be ordered before constrained -->
                <!-- marked constrained - must be ordered after unconstrained -->
                <RegExpr String="#{2}.+?#{2}|&quoted_pre;#&quoted;#&quoted_post;" attribute="Marked"/>
            </context>

            <context name="R monospaced" attribute="Normal" lineEndContext="#stay">
                <!-- monospaced unconstrained - must be ordered before constrained -->
                <!-- monospaced constrained - must be ordered after unconstrained -->
                <RegExpr String="`{2}[^`].*?`{2}|&quoted_pre;`&quoted;`&quoted_post;" attribute="Monospaced"/>
            </context>

            <!-- replacements -->
            <context name="R replacement" attribute="Normal" lineEndContext="#stay">
                <!-- copyright -->
                <StringDetect String="(C)" attribute="Replacement"/>
                <!-- registered -->
                <StringDetect String="(R)" attribute="Replacement"/>
                <!-- trademark -->
                <StringDetect String="(TM)" attribute="Replacement"/>
                <!-- apostrophe, only when between alphabetic characters -->
                <RegExpr String="(?&lt;=[&alp;])'(?=[&alp;])" attribute="Replacement"/>
                <!-- ellipses -->
                <StringDetect String="..." attribute="Replacement"/>
                <!-- mdash -->
                <Detect2Chars char="-" char1="-" attribute="Replacement"/>
                <!-- left single arrow -->
                <Detect2Chars char="&lt;" char1="-" attribute="Replacement"/>
                <!-- right single arrow -->
                <Detect2Chars char="-" char1="&gt;" attribute="Replacement"/>
                <!-- left double arrow -->
                <Detect2Chars char="&lt;" char1="=" attribute="Replacement"/>
                <!-- right double arrow -->
                <Detect2Chars char="=" char1="&gt;" attribute="Replacement"/>
                <!-- unicode character reference -->
                <RegExpr String="&char_ref;" attribute="Replacement"/>
            </context>

            <context name="R section inline" attribute="Normal" lineEndContext="#stay">
                <!-- literal paragraph started by a line with leading spaces -->
                <RegExpr String="^\s+(?!&list_marker;)\S.*" attribute="Verbatim" context="verbatim paragraph" column="0"/>
                <IncludeRules context="R block"/>
                <IncludeRules context="R anchor"/>
                <IncludeRules context="R comment"/>
                <IncludeRules context="R media"/>
                <IncludeRules context="R preprocessor"/>
                <IncludeRules context="R horizontal rules and page break"/>
            </context>

            <!-- first line of a section block -->
            <context name="R section block" attribute="Normal" lineEndContext="#pop!section block continuation" lineEmptyContext="#pop">
                <IncludeRules context="R callout"/>
                <RegExpr String="^\+\s*$" attribute="Control" context="#pop" column="0"/>
                <IncludeRules context="R admonition"/>
                <IncludeRules context="R block"/>
                <IncludeRules context="R shared"/>
                <IncludeRules context="R empty"/>
                <IncludeRules context="R normal"/>
            </context>

            <!-- callout as being used below a source code block -->
            <context name="R callout" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
                <RegExpr String="^&lt;(?:\.|\d+)&gt;(?=\s+\S)" attribute="Callout" context="#pop!callout" column="0"/>
            </context>
            <context name="callout" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
                <IncludeRules context="R callout"/>
                <IncludeRules context="section block continuation"/>
            </context>

            <!-- line 2 and following of a section block -->
            <context name="section block continuation" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
                <RegExpr String="^\+\s*$" attribute="Control" context="#pop" column="0"/>
                <IncludeRules context="R block without title"/>
                <IncludeRules context="R shared"/>
                <IncludeRules context="R empty"/>
                <IncludeRules context="R normal"/>
            </context>

            <context name="R empty" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="^\s+$" attribute="Normal" context="#pop" column="0"/>
            </context>

            <context name="R shared" attribute="Normal" lineEndContext="#stay">
                <!-- the escaped forms must be ordered before the not escaped forms -->
                <DetectChar char="\" attribute="Normal" context="backlash"/>

                <!-- passthrough - inline, must be ordered before other rules
                     The macro form pass: is part of "R macro" context -->
                <RegExpr String="&quoted_pre_pass;(\+{1,3})&quoted;\g1&quoted_post;" attribute="Passthrough"/>

                <IncludeRules context="R anchor"/>
                <IncludeRules context="R attribute"/>
                <IncludeRules context="R comment"/>
                <IncludeRules context="R include"/>
                <IncludeRules context="R macro"/>

                <!-- counter and counter2 -->
                <RegExpr String="\{counter2?:\s*&id;\s*(?::\s*(?:\d+|[&alp;])\s*)?\}" minimal="true" attribute="Attribute"/>

                <!-- horizontal rules and page break -->
                <!-- to enable highlighting of the horizontal rules using "- - -" or "* * *",
                     keep this before the checklist and unnumbered list definition -->
                <IncludeRules context="R horizontal rules and page break"/>

                <!-- cross reference -->
                <RegExpr String="&lt;&lt;[^&lt;\s].*?&gt;&gt;" attribute="Link"/>

                <!-- index term -->
                <RegExpr String="\({3}.+?\){3}|\({2}.+?\){2}|indexterm2?:\[.+?\]" attribute="Preprocessor"/>

                <!-- marker for description list -->
                <!-- marker for numbered list -->
                <!-- marker for checklist and bulleted/unnumbered list
                     To enable highlighting of the horizontal rules using "- - -" or "* * *",
                     keep this after the horizontal rules definition -->
                <RegExpr String="^\s*&list_marker;" attribute="List Marker" column="0"/>

                <!-- media - block format -->
                <IncludeRules context="R media"/>

                <!-- links -->
                <RegExpr String="(?&lt;=^|[\s\[\]();&lt;&gt;])(?:ftp|https?|irc)://[^\s\[]*?(?:\[\]|\[.*?[^\\]\]|(?=(?:[\[\]]|[\.,;:]??(?:\s|$))))|&link_mailto;|&email;" attribute="Link"/>

                <!-- preprocessor -->
                <!-- general meta data attribute list - must be ordered after other rules matching for lines of the form of [some content] -->
                <IncludeRules context="R preprocessor"/>

                <!-- continuation `+`, both at end of line and on a line on its own -->
                <RegExpr String="(?:^|\s)\s*\+\s*$" lookAhead="true" attribute="Normal" context="continuation"/>

                <!-- formatted/quoted must be ordered after unnumbered list -->
                <IncludeRules context="R formatted"/>
                <!-- replacements are done only if nothing else matched -->
                <IncludeRules context="R replacement"/>
            </context>

            <context name="R media" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="^(?:audio|image|video)::.*\[.*?\](?=\s*$)" attribute="Preprocessor" column="0"/>
            </context>

            <context name="R preprocessor" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="^ifn?def::&id;(?:[,\+]&id;)*\[.*\]|^ifeval::\[.*\]|^endif::(?:&id;)?\[\]|^\[[^\s\[].*\](?=\s*$)" attribute="Preprocessor" column="0"/>
            </context>

            <context name="R horizontal rules and page break" attribute="Normal" lineEndContext="#stay">
                <RegExpr String="^(?:'{3}|-{3}|\*{3}|- - -|\* \* \*|&lt;{3})\s*$" attribute="Control" column="0"/>
            </context>

            <!-- common rules for main title, section title, block title -->
            <context name="R title" attribute="Normal" lineEndContext="#stay">
                <DetectSpaces/>
                <DetectIdentifier/>
                <!-- the escaped forms must be ordered before the not escaped forms -->
                <DetectChar char="\" attribute="Section Title" context="backlash"/>
                <IncludeRules context="R anchor"/>
                <IncludeRules context="R attribute usage"/>
                <IncludeRules context="R marked"/>
                <IncludeRules context="R monospaced"/>
            </context>
        </contexts>

        <itemDatas>
            <itemData name="Anchor" defStyleNum="dsFunction"/>
            <itemData name="Attribute" defStyleNum="dsVariable"/>
            <itemData name="Attribute Value" defStyleNum="dsVariable" italic="true"/>
            <itemData name="Block Title" defStyleNum="dsString" italic="true"/>
            <itemData name="Callout" defStyleNum="dsNormal" bold="true" underline="true"/>
            <itemData name="Comment" defStyleNum="dsComment"/>
            <itemData name="Control" defStyleNum="dsControlFlow" bold="true" underline="true"/>
            <itemData name="Delimiter" defStyleNum="dsPreprocessor" bold="true"/>
            <itemData name="Emphasized" defStyleNum="dsNormal" italic="true"/>
            <itemData name="Emphasized Monospaced" defStyleNum="dsDocumentation" italic="true"/>
            <itemData name="Emphasized Monospaced Strong" defStyleNum="dsDocumentation" bold="true" italic="true"/>
            <itemData name="Emphasized Strong" defStyleNum="dsNormal" bold="true" italic="true"/>
            <itemData name="Link" defStyleNum="dsVariable" underline="true"/>
            <itemData name="List Marker" defStyleNum="dsNormal" bold="true"/>
            <itemData name="Main Title" defStyleNum="dsNormal" bold="true"/>
            <itemData name="Marked" defStyleNum="dsFloat"/>
            <itemData name="Monospaced" defStyleNum="dsDocumentation"/>
            <itemData name="Monospaced Strong" defStyleNum="dsDocumentation" bold="true"/>
            <itemData name="Normal" defStyleNum="dsNormal"/>
            <itemData name="Passthrough" defStyleNum="dsSpecialString"/>
            <itemData name="Preprocessor" defStyleNum="dsPreprocessor"/>
            <itemData name="Replacement" defStyleNum="dsNormal" bold="true" underline="true"/>
            <itemData name="Section Title" defStyleNum="dsString" bold="true"/>
            <itemData name="Strong" defStyleNum="dsNormal" bold="true"/>
            <itemData name="Subscript" defStyleNum="dsNormal" underline="true"/>
            <itemData name="Superscript" defStyleNum="dsNormal" bold="true" underline="true"/>
            <itemData name="Verbatim" defStyleNum="dsDocumentation"/>
        </itemDatas>
    </highlighting>

    <general>
        <comments>
            <comment name="singleLine" start="//"/>
            <comment name="multiLine" start="////" end="////" region="comment"/>
        </comments>
        <keywords casesensitive="1"/>
    </general>
</language>
<!-- kate: replace-tabs on; tab-width 4; indent-width 4; -->