Warning, /frameworks/syntax-highlighting/data/syntax/asciidoc.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language [
0003     <!-- alphabetic -->
0004     <!ENTITY alp "a-zA-Z">
0005     <!-- alphanumeric -->
0006     <!ENTITY aln "&alp;0-9">
0007     <!ENTITY id "\w[\w-]+">
0008     <!-- percent symbol, needs to be encoded inside an entity definition -->
0009     <!ENTITY perc "&#x0025;">
0010 
0011     <!ENTITY admonition_names "CAUTION|IMPORTANT|NOTE|TIP|WARNING">
0012 
0013     <!-- regular expression parts to identify anchors -->
0014     <!ENTITY anchor_mid "&id;(?:,.+?)?">
0015     <!ENTITY anchor_phrase "#\S(?:.*?\S)?#">
0016 
0017     <!-- block delimiters -->
0018     <!ENTITY block_dels_comment "/{4,}">
0019     <!ENTITY block_dels_normal "={4,}|_{4,}|\*{4,}|-{2}|&quot;{2}">
0020     <!ENTITY block_dels_pass "\+{4,}">
0021     <!ENTITY block_dels_verbatim "`{3}|-{4,}|\.{4,}">
0022     <!-- postfix/trailing part of block name -->
0023     <!ENTITY block_name_post "(?:[#&perc;].+)?\s*(?:,.*)?\]\s*$">
0024     <!-- block end delimiter, dynamic matching: "^%1\s*$" -->
0025     <!ENTITY block_end_del "^&perc;1\s*$">
0026 
0027     <!-- unicode character reference, decimal and hexadecimal -->
0028     <!ENTITY char_ref "&amp;#(?:\d{2,4}|x[\da-fA-F]{2,4});">
0029 
0030     <!-- email - inline -->
0031     <!ENTITY email "\w[\w.&perc;+-]*@[&aln;][&aln;.-]*\.[&alp;]{2,4}\b">
0032 
0033     <!-- link macro and mailto: -->
0034     <!ENTITY link_mailto "(?:link|mailto):[^:\s\[][^\s\[]*\[(?:\]|.*?[^\\]\])">
0035 
0036     <!-- macro -->
0037     <!ENTITY macro "(?:anchor|xref):&id;\[.*?\]|(?:btn|footnote(?:ref)?|kbd):\[.*?\]|pass:\w*\[.*?\]|(?:icon|image|menu):[^:].*?\[.*?\]|toc::\[\]">
0038 
0039     <!ENTITY list_marker "(?:\S.+::(?=\s|$)|(?:(?:\.+|\d+\.)|(?:-|\*+)(?:\s+\[[*x ]\])?)(?=\s+\S))">
0040 
0041     <!ENTITY table_option_delimiter "(?:(?:\d*\.)?\d+\+|\d+\*)?(?:[&lt;&gt;^]?\.?[&lt;&gt;^])?[adehlmsv]?\|">
0042 
0043     <!-- parts to build regular expressions to identify quoted (formatted) text
0044          E.g. emphasized, marked, strong. -->
0045     <!-- prefix/leading part -->
0046     <!ENTITY quoted_pre "(?&lt;=^|[^\w;:}])">
0047     <!ENTITY quoted_pre_pass "(?&lt;=^|\W)">
0048     <!-- central part -->
0049     <!ENTITY quoted "\S(?:.*?\S)??">
0050     <!-- postfix/trailing part -->
0051     <!ENTITY quoted_post "(?=\W|$)">
0052 ]>
0053 <language author="Andreas Gratzer" extensions="*.ad;*.adoc;*.asciidoc" kateversion="5.0" mimetype="text/asciidoc" name="AsciiDoc" license="MIT" section="Markup" version="9">
0054     <highlighting>
0055         <list name="macro">
0056             <item>anchor</item>
0057             <item>btn</item>
0058             <item>footnote</item>
0059             <item>footnoteref</item>
0060             <item>icon</item>
0061             <item>image</item>
0062             <item>indexterm</item>
0063             <item>indexterm2</item>
0064             <item>kbd</item>
0065             <item>menu</item>
0066             <item>pass</item>
0067             <item>toc</item>
0068             <item>xref</item>
0069         </list>
0070 
0071         <contexts>
0072             <context name="start" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
0073                 <!-- section title level 0 to 5 -->
0074                 <RegExpr String="^(?:={1,6}|#{1,6})\s+(?=\S)" lookAhead="1" context="dispatch section main title" column="0"/>
0075                 <IncludeRules context="R section inline"/>
0076             </context>
0077 
0078             <!-- attribute value definition, may span multiple lines -->
0079             <context name="attribute value" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
0080                 <!-- line with continuation -->
0081                 <RegExpr String=".*?(?=\s+(?:\+\s+)?\\\s*$)" attribute="Attribute Value" context="continuation"/>
0082                 <!-- line without continuation, terminates value definition -->
0083                 <RegExpr String=".*" attribute="Attribute Value" context="#pop"/>
0084             </context>
0085             <!-- inline attribute value definition -->
0086             <context name="attribute value inline" attribute="Attribute Value" lineEndContext="#stay">
0087                 <!-- the leading `:` is part of the definition syntax and should not be highlighted as value -->
0088                 <DetectChar char=":" attribute="Attribute" context="attribute value inline L2"/>
0089                 <DetectChar char="}" attribute="Attribute" context="#pop"/>
0090             </context>
0091             <context name="attribute value inline L2" attribute="Attribute Value" lineEndContext="#stay">
0092                 <DetectChar char="}" attribute="Attribute" context="#pop#pop"/>
0093             </context>
0094 
0095             <!-- backlash, may function as an escape -->
0096             <context name="backlash" attribute="Normal" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
0097                 <!-- attribute usage
0098                      formatted/quoted text
0099                      replacement of apostrophe
0100                      table separator (default)
0101                      anchor, consuming leading char will make anchor matches fail
0102                      cross reference
0103                      indexterm, consuming leading char will make matches fail
0104                 -->
0105                 <!-- replacement (besides apostrophe -->
0106                 <Detect2Chars char="&lt;" char1="-" attribute="Normal" context="#pop"/>
0107                 <Detect2Chars char="&lt;" char1="=" attribute="Normal" context="#pop"/>
0108                 <AnyChar String="_#`+*~^'|{[&lt;(" attribute="Normal" context="#pop"/>
0109                 <Detect2Chars char="-" char1="-" attribute="Normal" context="#pop"/>
0110                 <Detect2Chars char="-" char1="&gt;" attribute="Normal" context="#pop"/>
0111                 <Detect2Chars char="=" char1="&gt;" attribute="Normal" context="#pop"/>
0112                 <StringDetect String="..." attribute="Normal" context="#pop"/>
0113                 <!-- email - inline, needs to be ordered after mailto: -->
0114                 <!-- link and mailto macros, note that ftp, irc, http(s) don't match with leading `\` anyway -->
0115                 <RegExpr String="&email;|&link_mailto;|&char_ref;" attribute="Normal" context="#pop"/>
0116                 <!-- macro -->
0117                 <keyword String="macro" attribute="Normal" context="#pop"/>
0118             </context>
0119 
0120             <context name="block title" attribute="Block Title" lineEndContext="#pop">
0121                 <IncludeRules context="R title"/>
0122             </context>
0123 
0124             <context name="comment" attribute="Comment" lineEndContext="#stay" lineEmptyContext="#pop">
0125                 <DetectSpaces attribute="Comment"/>
0126                 <RegExpr String="^(&block_dels_comment;)\s*$" attribute="Comment" context="#pop!comment delimited" beginRegion="comment" column="0"/>
0127                 <IncludeRules context="R anchor"/>
0128                 <IncludeRules context="R block title"/>
0129                 <IncludeRules context="##Comments"/>
0130                 <DetectIdentifier attribute="Comment"/>
0131             </context>
0132             <context name="comment delimited" attribute="Comment" lineEndContext="#stay">
0133                 <DetectSpaces attribute="Comment"/>
0134                 <RegExpr String="&block_end_del;" dynamic="true" attribute="Comment" context="#pop" endRegion="comment" column="0"/>
0135                 <IncludeRules context="##Comments" />
0136                 <DetectIdentifier attribute="Comment"/>
0137             </context>
0138             <context name="comment single-line" attribute="Comment" lineEndContext="#pop">
0139                 <DetectSpaces attribute="Comment"/>
0140                 <IncludeRules context="##Comments" />
0141                 <DetectIdentifier attribute="Comment"/>
0142             </context>
0143 
0144             <!-- continuation, both for normal text and attribute value definition
0145                  The allowed pattern must already by validated.
0146                  Here only the possible characters are highlighted. -->
0147             <context name="continuation" attribute="Normal" lineEndContext="#pop">
0148                 <AnyChar String="+\" attribute="Control"/>
0149             </context>
0150 
0151             <context name="main title" attribute="Main Title" lineEndContext="#pop!section L0">
0152                 <IncludeRules context="R title"/>
0153             </context>
0154 
0155             <context name="normal" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
0156                 <RegExpr String="^(-{2}|&block_dels_normal;)\s*$" attribute="Delimiter" context="#pop!normal delimited" beginRegion="block" column="0"/>
0157                 <IncludeRules context="R block title"/>
0158                 <!-- shared rules includes anchor rules, so we do not need to include that separately -->
0159                 <IncludeRules context="R shared"/>
0160                 <IncludeRules context="R normal"/>
0161             </context>
0162             <context name="normal delimited" attribute="Normal" lineEndContext="#stay">
0163                 <RegExpr String="&block_end_del;" dynamic="true" attribute="Delimiter" context="#pop" endRegion="block" column="0"/>
0164                 <IncludeRules context="R admonition"/>
0165                 <IncludeRules context="R block"/>
0166                 <!-- shared rules includes anchor rules, so we do not need to include that separately -->
0167                 <IncludeRules context="R shared"/>
0168                 <IncludeRules context="R normal"/>
0169             </context>
0170 
0171             <context name="passthrough" attribute="Passthrough" lineEndContext="#stay" lineEmptyContext="#pop">
0172                 <DetectSpaces attribute="Passthrough"/>
0173                 <IncludeRules context="R include"/>
0174                 <DetectIdentifier attribute="Passthrough"/>
0175                 <RegExpr String="^(&block_dels_pass;)\s*$" attribute="Delimiter" context="#pop!passthrough delimited" beginRegion="block" column="0"/>
0176                 <IncludeRules context="R anchor"/>
0177                 <IncludeRules context="R block title"/>
0178             </context>
0179             <context name="passthrough delimited" attribute="Passthrough" lineEndContext="#stay">
0180                 <RegExpr String="&block_end_del;" dynamic="true" attribute="Delimiter" context="#pop" endRegion="block" column="0"/>
0181                 <IncludeRules context="R include"/>
0182             </context>
0183 
0184             <context name="dispatch section main title" attribute="Normal" lineEndContext="#stay">
0185                 <IncludeRules context="dispatch section title L1-5"/>
0186                 <!-- main title, first level 0 section title -->
0187                 <AnyChar String="=#" attribute="Main Title" context="#pop!main title" beginRegion="section" column="0"/>
0188             </context>
0189 
0190             <context name="dispatch section title L0-5" attribute="Normal" lineEndContext="#stay">
0191                 <IncludeRules context="dispatch section title L1-5"/>
0192                 <AnyChar String="=#" attribute="Section Title" context="#pop!section title L0" beginRegion="section" endRegion="section" column="0"/>
0193             </context>
0194             <context name="dispatch section title L1-5" attribute="Normal" lineEndContext="#stay">
0195                 <IncludeRules context="dispatch section title L2-5"/>
0196                 <Detect2Chars char="=" char1="=" attribute="Section Title" context="#pop!section title L1" beginRegion="section" column="0"/>
0197                 <Detect2Chars char="#" char1="#" attribute="Section Title" context="#pop!section title L1" beginRegion="section" column="0"/>
0198             </context>
0199             <context name="dispatch section title L2-5" attribute="Normal" lineEndContext="#stay">
0200                 <IncludeRules context="dispatch section title L3-5"/>
0201                 <StringDetect String="===" attribute="Section Title" context="#pop!section title L2" beginRegion="section" column="0"/>
0202                 <StringDetect String="###" attribute="Section Title" context="#pop!section title L2" beginRegion="section" column="0"/>
0203             </context>
0204             <context name="dispatch section title L3-5" attribute="Normal" lineEndContext="#stay">
0205                 <IncludeRules context="dispatch section title L4-5"/>
0206                 <StringDetect String="====" attribute="Section Title" context="#pop!section title L3" beginRegion="section" column="0"/>
0207                 <StringDetect String="####" attribute="Section Title" context="#pop!section title L3" beginRegion="section" column="0"/>
0208             </context>
0209             <context name="dispatch section title L4-5" attribute="Normal" lineEndContext="#stay">
0210                 <IncludeRules context="dispatch section title L5"/>
0211                 <StringDetect String="=====" attribute="Section Title" context="#pop!section title L4" beginRegion="section" column="0"/>
0212                 <StringDetect String="#####" attribute="Section Title" context="#pop!section title L4" beginRegion="section" column="0"/>
0213             </context>
0214             <context name="dispatch section title L5" attribute="Normal" lineEndContext="#stay">
0215                 <StringDetect String="======" attribute="Section Title" context="#pop!section title L5" beginRegion="section" column="0"/>
0216                 <StringDetect String="######" attribute="Section Title" context="#pop!section title L5" beginRegion="section" column="0"/>
0217             </context>
0218 
0219             <context name="section L0" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
0220                 <RegExpr String="^(?:={1,6}|#{1,6})\s+(?=\S)" lookAhead="1" context="dispatch section title L0-5" column="0"/>
0221                 <IncludeRules context="section L5"/>
0222             </context>
0223 
0224             <context name="section L1" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
0225                 <RegExpr String="^(?:={3,6}|#{3,6})\s+(?=\S)" lookAhead="1" context="dispatch section title L2-5" column="0"/>
0226                 <IncludeRules context="section L5"/>
0227             </context>
0228 
0229             <context name="section L2" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
0230                 <RegExpr String="^(?:={4,6}|#{4,6})\s+(?=\S)" lookAhead="1" context="dispatch section title L3-5" column="0"/>
0231                 <IncludeRules context="section L5"/>
0232             </context>
0233 
0234             <context name="section L3" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
0235                 <RegExpr String="^(?:={5,6}|#{5,6})\s+(?=\S)" lookAhead="1" context="dispatch section title L4-5" column="0"/>
0236                 <IncludeRules context="section L5"/>
0237             </context>
0238 
0239             <context name="section L4" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
0240                 <RegExpr String="^(?:={6}|#{6})\s+(?=\S)" lookAhead="1" context="dispatch section title L5" column="0"/>
0241                 <IncludeRules context="section L5"/>
0242             </context>
0243 
0244             <context name="section L5" attribute="Normal" lineEndContext="#stay" fallthrough="1" fallthroughContext="R section block">
0245                 <RegExpr String="^(?:={1,6}|#{1,6})\s+\S" lookAhead="1" context="#pop" endRegion="section" column="0"/>
0246                 <IncludeRules context="R section inline"/>
0247             </context>
0248 
0249             <context name="section title L0" attribute="Section Title" lineEndContext="#pop">
0250                 <IncludeRules context="R title"/>
0251             </context>
0252 
0253             <context name="section title L1" attribute="Section Title" lineEndContext="#pop!section L1">
0254                 <IncludeRules context="R title"/>
0255             </context>
0256 
0257             <context name="section title L2" attribute="Section Title" lineEndContext="#pop!section L2">
0258                 <IncludeRules context="R title"/>
0259             </context>
0260 
0261             <context name="section title L3" attribute="Section Title" lineEndContext="#pop!section L3">
0262                 <IncludeRules context="R title"/>
0263             </context>
0264 
0265             <context name="section title L4" attribute="Section Title" lineEndContext="#pop!section L4">
0266                 <IncludeRules context="R title"/>
0267             </context>
0268 
0269             <context name="section title L5" attribute="Section Title" lineEndContext="#pop!section L5">
0270                 <IncludeRules context="R title"/>
0271             </context>
0272 
0273             <context name="table" attribute="Normal" lineEndContext="#stay">
0274                 <RegExpr String="&block_end_del;" dynamic="true" attribute="Delimiter" context="#pop" endRegion="block" column="0"/>
0275                 <!-- `|` with prefix for alignment, style etc. -->
0276                 <RegExpr String="(?&lt;=^|\s)&table_option_delimiter;" attribute="Delimiter"/>
0277                 <!-- simple `|` without alignment, style etc. -->
0278                 <DetectChar char="|" attribute="Delimiter"/>
0279                 <IncludeRules context="R shared"/>
0280                 <IncludeRules context="R normal"/>
0281             </context>
0282 
0283             <context name="verbatim" attribute="Verbatim" lineEndContext="#stay">
0284                 <RegExpr String="^(-{2}|&block_dels_verbatim;)\s*$" attribute="Delimiter" context="#pop!verbatim delimited" beginRegion="block" column="0"/>
0285                 <IncludeRules context="R anchor"/>
0286                 <RegExpr String="^(\[\w+[^,\]]*(,[^,\]]*)*\]\s*)+$" attribute="Preprocessor" column="0"/>
0287                 <IncludeRules context="R block title"/>
0288                 <IncludeRules context="R comment"/>
0289                 <IncludeRules context="R include"/>
0290                 <RegExpr String="^.*" attribute="Verbatim" context="#pop!verbatim paragraph" column="0"/>
0291             </context>
0292             <context name="verbatim delimited" attribute="Verbatim" lineEndContext="#stay">
0293                 <RegExpr String="&block_end_del;" dynamic="true" attribute="Delimiter" context="#pop" endRegion="block" column="0"/>
0294                 <IncludeRules context="R include"/>
0295             </context>
0296             <context name="verbatim paragraph" attribute="Verbatim" lineEndContext="#stay" lineEmptyContext="#pop">
0297                 <IncludeRules context="R include"/>
0298             </context>
0299 
0300             <!-- contexts to be used for IncludeRules only -->
0301 
0302             <context name="R normal" attribute="Normal" lineEndContext="#stay">
0303                 <!-- Regex which allows to quickly consume text that is not
0304                     - macro
0305                     - continuation
0306                     - index term
0307                     - link
0308                     - replacement
0309                     - preprocessor
0310                     - formatted text
0311                     - table delimiter
0312 
0313                 maanchor:anchor-id[Macro Anchor]
0314                 ^ Normal
0315                   ^ Macro
0316 
0317                 bla__bla__bla
0318                 ^ Normal
0319                    ^ Emphasized
0320                           ^ Normal
0321 
0322                 For some reason, Asciidoctor recognizes emails with leading : or / but does not render them as link
0323 
0324                 /example@mail.com
0325                 ^ Normal
0326 
0327                 example@mail.com
0328                 ^ Link
0329                 -->
0330                 <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"/>
0331             </context>
0332 
0333             <context name="R admonition" attribute="Normal" lineEndContext="#stay">
0334                 <!-- admonition - simple form, block form is part of block rules -->
0335                 <RegExpr String="^(?:&admonition_names;):(?=\s+\S)" attribute="Preprocessor" context="normal" column="0"/>
0336             </context>
0337 
0338             <context name="R anchor" attribute="Normal" lineEndContext="#stay">
0339                 <!-- shorthand form at line start -->
0340                 <!-- bibliographic anchor -->
0341                 <!-- normal form -->
0342                 <!-- shorthand form inline -->
0343                 <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"/>
0344             </context>
0345 
0346             <context name="R attribute" attribute="Normal" lineEndContext="#stay">
0347                 <!-- attribute definition without value / unset attribute -->
0348                 <RegExpr String="^:!?&id;!?:$" attribute="Attribute" column="0"/>
0349                 <!-- attribute definition with value -->
0350                 <RegExpr String="^:!?&id;!?:\s(?=\S)" attribute="Attribute" context="attribute value" column="0"/>
0351                 <!-- attribute inline definition -->
0352                 <RegExpr String="\{set:&id;(?=(?::.*)?\})" minimal="true" attribute="Attribute" context="attribute value inline"/>
0353                 <IncludeRules context="R attribute usage"/>
0354             </context>
0355 
0356             <context name="R attribute usage" attribute="Normal" lineEndContext="#stay">
0357                 <RegExpr String="\{&id;\}" attribute="Attribute"/>
0358             </context>
0359 
0360             <context name="R block" attribute="Normal" lineEndContext="#stay">
0361                 <IncludeRules context="R block title"/>
0362                 <IncludeRules context="R block without title"/>
0363             </context>
0364 
0365             <context name="R block without title" attribute="Normal" lineEndContext="#stay">
0366                 <!-- name matching -->
0367                 <RegExpr String="^\[(?:&admonition_names;)&block_name_post;|^\[(?:example|quote|sidebar|verse)&block_name_post;" attribute="Preprocessor" context="normal" column="0"/>
0368                 <RegExpr String="^\[(?:pass|stem)&block_name_post;" attribute="Preprocessor" context="passthrough" column="0"/>
0369                 <RegExpr String="^\[(?:listing|literal|source)&block_name_post;" attribute="Preprocessor" context="verbatim" column="0"/>
0370 
0371                 <!-- delimiter matching -->
0372                 <RegExpr String="^(&block_dels_normal;)\s*$" attribute="Delimiter" context="normal delimited" beginRegion="block" column="0"/>
0373                 <RegExpr String="^(&block_dels_pass;)\s*$" attribute="Delimiter" context="passthrough delimited" beginRegion="block" column="0"/>
0374                 <RegExpr String="^(\|={3,})\s*$" attribute="Delimiter" context="table" beginRegion="block" column="0"/>
0375                 <RegExpr String="^(&block_dels_verbatim;)\s*$" attribute="Delimiter" context="verbatim delimited" beginRegion="block" column="0"/>
0376             </context>
0377 
0378             <context name="R block title" attribute="Normal" lineEndContext="#stay">
0379                 <!-- not more than 3 leading dots followed by a non-dot, otherwise it would conflict with the delimited literal block -->
0380                 <RegExpr String="^\.{1,3}(?=[^\.\s])" attribute="Block Title" context="block title" column="0"/>
0381             </context>
0382 
0383             <context name="R comment" attribute="Normal" lineEndContext="#stay">
0384                 <!-- comment - multi-line, named block -->
0385                 <RegExpr String="^\[comment&block_name_post;" attribute="Preprocessor" context="comment" column="0"/>
0386                 <!-- comment - multi-line, delimited block -->
0387                 <RegExpr String="^(&block_dels_comment;)\s*$" attribute="Comment" context="comment delimited" beginRegion="comment" column="0"/>
0388                 <!-- comment - single line -->
0389                 <RegExpr String="^/{2}(?:[^/]|$)" attribute="Comment" context="comment single-line" column="0"/>
0390             </context>
0391 
0392             <context name="R formatted" attribute="Normal" lineEndContext="#stay">
0393                 <!-- custom style, e.g. [underline]#underlined text# -->
0394                 <RegExpr String="(?&lt;=^|\W)\[[^\]]+?\]([#_`*]{1,2})&quoted;\g1&quoted_post;" attribute="Preprocessor"/>
0395 
0396                 <!-- combined highlighting must be ordered before simple highlighting -->
0397 
0398                 <!-- emphasized monospaced strong unconstrained - must be ordered before constrained -->
0399                 <!-- emphasized monospaced strong - constrained must be ordered after unconstrained -->
0400                 <RegExpr String="`{2}\*_.*?_\*`{2}|&quoted_pre;`\*_&quoted;_\*`&quoted_post;" attribute="Emphasized Monospaced Strong"/>
0401 
0402                 <!-- emphasized strong unconstrained - must be ordered before constrained -->
0403                 <!-- emphasized strong constrained - must be ordered after unconstrained -->
0404                 <RegExpr String="\*{2}_.*?_\*{2}|&quoted_pre;\*_&quoted;_\*&quoted_post;" attribute="Emphasized Strong"/>
0405 
0406                 <!-- monospaced strong unconstrained - must be ordered before constrained -->
0407                 <!-- monospaced strong constrained - must be ordered after unconstrained -->
0408                 <RegExpr String="`{2}\*.*?\*`{2}|&quoted_pre;`\*&quoted;\*`&quoted_post;" attribute="Monospaced Strong"/>
0409 
0410                 <!-- emphasized monospaced unconstrained - must be ordered before constrained -->
0411                 <!-- emphasized monospaced constrained - must be ordered after unconstrained -->
0412                 <RegExpr String="`{2}_.*?_`{2}|&quoted_pre;`_&quoted;_`&quoted_post;" attribute="Emphasized Monospaced"/>
0413 
0414                 <!-- strong unconstrained - must be ordered before constrained -->
0415                 <!-- strong constrained - must be ordered after unconstrained -->
0416                 <RegExpr String="\*{2}[^*].*?\*{2}|&quoted_pre;\*&quoted;\*&quoted_post;" attribute="Strong"/>
0417 
0418                 <!-- emphasized unconstrained - must be ordered before constrained -->
0419                 <!-- emphasized constrained - must be ordered after unconstrained
0420                      Can't use &quoted_pre; as that excludes \w which excludes `_` too. -->
0421                 <RegExpr String="_{2}[^_].*?_{2}|(?&lt;=^|[^&alp;;:}])_&quoted;_&quoted_post;" attribute="Emphasized"/>
0422 
0423                 <IncludeRules context="R marked"/>
0424                 <IncludeRules context="R monospaced"/>
0425 
0426                 <!-- subscript -->
0427                 <RegExpr String="~\S+~" minimal="true" attribute="Subscript"/>
0428                 <!-- superscript -->
0429                 <RegExpr String="\^\S+\^" minimal="true" attribute="Superscript"/>
0430             </context>
0431 
0432             <context name="R include" attribute="Normal" lineEndContext="#stay">
0433                 <RegExpr String="^include::.*\[.*?\](?=\s*$)" attribute="Preprocessor" column="0"/>
0434             </context>
0435 
0436             <context name="R macro" attribute="Normal" lineEndContext="#stay">
0437                 <RegExpr String="&macro;" attribute="Preprocessor"/>
0438             </context>
0439 
0440             <context name="R marked" attribute="Normal" lineEndContext="#stay">
0441                 <!-- marked unconstrained - must be ordered before constrained -->
0442                 <!-- marked constrained - must be ordered after unconstrained -->
0443                 <RegExpr String="#{2}.+?#{2}|&quoted_pre;#&quoted;#&quoted_post;" attribute="Marked"/>
0444             </context>
0445 
0446             <context name="R monospaced" attribute="Normal" lineEndContext="#stay">
0447                 <!-- monospaced unconstrained - must be ordered before constrained -->
0448                 <!-- monospaced constrained - must be ordered after unconstrained -->
0449                 <RegExpr String="`{2}[^`].*?`{2}|&quoted_pre;`&quoted;`&quoted_post;" attribute="Monospaced"/>
0450             </context>
0451 
0452             <!-- replacements -->
0453             <context name="R replacement" attribute="Normal" lineEndContext="#stay">
0454                 <!-- copyright -->
0455                 <StringDetect String="(C)" attribute="Replacement"/>
0456                 <!-- registered -->
0457                 <StringDetect String="(R)" attribute="Replacement"/>
0458                 <!-- trademark -->
0459                 <StringDetect String="(TM)" attribute="Replacement"/>
0460                 <!-- apostrophe, only when between alphabetic characters -->
0461                 <RegExpr String="(?&lt;=[&alp;])'(?=[&alp;])" attribute="Replacement"/>
0462                 <!-- ellipses -->
0463                 <StringDetect String="..." attribute="Replacement"/>
0464                 <!-- mdash -->
0465                 <Detect2Chars char="-" char1="-" attribute="Replacement"/>
0466                 <!-- left single arrow -->
0467                 <Detect2Chars char="&lt;" char1="-" attribute="Replacement"/>
0468                 <!-- right single arrow -->
0469                 <Detect2Chars char="-" char1="&gt;" attribute="Replacement"/>
0470                 <!-- left double arrow -->
0471                 <Detect2Chars char="&lt;" char1="=" attribute="Replacement"/>
0472                 <!-- right double arrow -->
0473                 <Detect2Chars char="=" char1="&gt;" attribute="Replacement"/>
0474                 <!-- unicode character reference -->
0475                 <RegExpr String="&char_ref;" attribute="Replacement"/>
0476             </context>
0477 
0478             <context name="R section inline" attribute="Normal" lineEndContext="#stay">
0479                 <!-- literal paragraph started by a line with leading spaces -->
0480                 <RegExpr String="^\s+(?!&list_marker;)\S.*" attribute="Verbatim" context="verbatim paragraph" column="0"/>
0481                 <IncludeRules context="R block"/>
0482                 <IncludeRules context="R anchor"/>
0483                 <IncludeRules context="R comment"/>
0484                 <IncludeRules context="R media"/>
0485                 <IncludeRules context="R preprocessor"/>
0486                 <IncludeRules context="R horizontal rules and page break"/>
0487             </context>
0488 
0489             <!-- first line of a section block -->
0490             <context name="R section block" attribute="Normal" lineEndContext="#pop!section block continuation" lineEmptyContext="#pop">
0491                 <IncludeRules context="R callout"/>
0492                 <RegExpr String="^\+\s*$" attribute="Control" context="#pop" column="0"/>
0493                 <IncludeRules context="R admonition"/>
0494                 <IncludeRules context="R block"/>
0495                 <IncludeRules context="R shared"/>
0496                 <IncludeRules context="R empty"/>
0497                 <IncludeRules context="R normal"/>
0498             </context>
0499 
0500             <!-- callout as being used below a source code block -->
0501             <context name="R callout" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
0502                 <RegExpr String="^&lt;(?:\.|\d+)&gt;(?=\s+\S)" attribute="Callout" context="#pop!callout" column="0"/>
0503             </context>
0504             <context name="callout" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
0505                 <IncludeRules context="R callout"/>
0506                 <IncludeRules context="section block continuation"/>
0507             </context>
0508 
0509             <!-- line 2 and following of a section block -->
0510             <context name="section block continuation" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop">
0511                 <RegExpr String="^\+\s*$" attribute="Control" context="#pop" column="0"/>
0512                 <IncludeRules context="R block without title"/>
0513                 <IncludeRules context="R shared"/>
0514                 <IncludeRules context="R empty"/>
0515                 <IncludeRules context="R normal"/>
0516             </context>
0517 
0518             <context name="R empty" attribute="Normal" lineEndContext="#stay">
0519                 <RegExpr String="^\s+$" attribute="Normal" context="#pop" column="0"/>
0520             </context>
0521 
0522             <context name="R shared" attribute="Normal" lineEndContext="#stay">
0523                 <!-- the escaped forms must be ordered before the not escaped forms -->
0524                 <DetectChar char="\" attribute="Normal" context="backlash"/>
0525 
0526                 <!-- passthrough - inline, must be ordered before other rules
0527                      The macro form pass: is part of "R macro" context -->
0528                 <RegExpr String="&quoted_pre_pass;(\+{1,3})&quoted;\g1&quoted_post;" attribute="Passthrough"/>
0529 
0530                 <IncludeRules context="R anchor"/>
0531                 <IncludeRules context="R attribute"/>
0532                 <IncludeRules context="R comment"/>
0533                 <IncludeRules context="R include"/>
0534                 <IncludeRules context="R macro"/>
0535 
0536                 <!-- counter and counter2 -->
0537                 <RegExpr String="\{counter2?:\s*&id;\s*(?::\s*(?:\d+|[&alp;])\s*)?\}" minimal="true" attribute="Attribute"/>
0538 
0539                 <!-- horizontal rules and page break -->
0540                 <!-- to enable highlighting of the horizontal rules using "- - -" or "* * *",
0541                      keep this before the checklist and unnumbered list definition -->
0542                 <IncludeRules context="R horizontal rules and page break"/>
0543 
0544                 <!-- cross reference -->
0545                 <RegExpr String="&lt;&lt;[^&lt;\s].*?&gt;&gt;" attribute="Link"/>
0546 
0547                 <!-- index term -->
0548                 <RegExpr String="\({3}.+?\){3}|\({2}.+?\){2}|indexterm2?:\[.+?\]" attribute="Preprocessor"/>
0549 
0550                 <!-- marker for description list -->
0551                 <!-- marker for numbered list -->
0552                 <!-- marker for checklist and bulleted/unnumbered list
0553                      To enable highlighting of the horizontal rules using "- - -" or "* * *",
0554                      keep this after the horizontal rules definition -->
0555                 <RegExpr String="^\s*&list_marker;" attribute="List Marker" column="0"/>
0556 
0557                 <!-- media - block format -->
0558                 <IncludeRules context="R media"/>
0559 
0560                 <!-- links -->
0561                 <RegExpr String="(?&lt;=^|[\s\[\]();&lt;&gt;])(?:ftp|https?|irc)://[^\s\[]*?(?:\[\]|\[.*?[^\\]\]|(?=(?:[\[\]]|[\.,;:]??(?:\s|$))))|&link_mailto;|&email;" attribute="Link"/>
0562 
0563                 <!-- preprocessor -->
0564                 <!-- general meta data attribute list - must be ordered after other rules matching for lines of the form of [some content] -->
0565                 <IncludeRules context="R preprocessor"/>
0566 
0567                 <!-- continuation `+`, both at end of line and on a line on its own -->
0568                 <RegExpr String="(?:^|\s)\s*\+\s*$" lookAhead="true" attribute="Normal" context="continuation"/>
0569 
0570                 <!-- formatted/quoted must be ordered after unnumbered list -->
0571                 <IncludeRules context="R formatted"/>
0572                 <!-- replacements are done only if nothing else matched -->
0573                 <IncludeRules context="R replacement"/>
0574             </context>
0575 
0576             <context name="R media" attribute="Normal" lineEndContext="#stay">
0577                 <RegExpr String="^(?:audio|image|video)::.*\[.*?\](?=\s*$)" attribute="Preprocessor" column="0"/>
0578             </context>
0579 
0580             <context name="R preprocessor" attribute="Normal" lineEndContext="#stay">
0581                 <RegExpr String="^ifn?def::&id;(?:[,\+]&id;)*\[.*\]|^ifeval::\[.*\]|^endif::(?:&id;)?\[\]|^\[[^\s\[].*\](?=\s*$)" attribute="Preprocessor" column="0"/>
0582             </context>
0583 
0584             <context name="R horizontal rules and page break" attribute="Normal" lineEndContext="#stay">
0585                 <RegExpr String="^(?:'{3}|-{3}|\*{3}|- - -|\* \* \*|&lt;{3})\s*$" attribute="Control" column="0"/>
0586             </context>
0587 
0588             <!-- common rules for main title, section title, block title -->
0589             <context name="R title" attribute="Normal" lineEndContext="#stay">
0590                 <DetectSpaces/>
0591                 <DetectIdentifier/>
0592                 <!-- the escaped forms must be ordered before the not escaped forms -->
0593                 <DetectChar char="\" attribute="Section Title" context="backlash"/>
0594                 <IncludeRules context="R anchor"/>
0595                 <IncludeRules context="R attribute usage"/>
0596                 <IncludeRules context="R marked"/>
0597                 <IncludeRules context="R monospaced"/>
0598             </context>
0599         </contexts>
0600 
0601         <itemDatas>
0602             <itemData name="Anchor" defStyleNum="dsFunction"/>
0603             <itemData name="Attribute" defStyleNum="dsVariable"/>
0604             <itemData name="Attribute Value" defStyleNum="dsVariable" italic="true"/>
0605             <itemData name="Block Title" defStyleNum="dsString" italic="true"/>
0606             <itemData name="Callout" defStyleNum="dsNormal" bold="true" underline="true"/>
0607             <itemData name="Comment" defStyleNum="dsComment"/>
0608             <itemData name="Control" defStyleNum="dsControlFlow" bold="true" underline="true"/>
0609             <itemData name="Delimiter" defStyleNum="dsPreprocessor" bold="true"/>
0610             <itemData name="Emphasized" defStyleNum="dsNormal" italic="true"/>
0611             <itemData name="Emphasized Monospaced" defStyleNum="dsDocumentation" italic="true"/>
0612             <itemData name="Emphasized Monospaced Strong" defStyleNum="dsDocumentation" bold="true" italic="true"/>
0613             <itemData name="Emphasized Strong" defStyleNum="dsNormal" bold="true" italic="true"/>
0614             <itemData name="Link" defStyleNum="dsVariable" underline="true"/>
0615             <itemData name="List Marker" defStyleNum="dsNormal" bold="true"/>
0616             <itemData name="Main Title" defStyleNum="dsNormal" bold="true"/>
0617             <itemData name="Marked" defStyleNum="dsFloat"/>
0618             <itemData name="Monospaced" defStyleNum="dsDocumentation"/>
0619             <itemData name="Monospaced Strong" defStyleNum="dsDocumentation" bold="true"/>
0620             <itemData name="Normal" defStyleNum="dsNormal"/>
0621             <itemData name="Passthrough" defStyleNum="dsSpecialString"/>
0622             <itemData name="Preprocessor" defStyleNum="dsPreprocessor"/>
0623             <itemData name="Replacement" defStyleNum="dsNormal" bold="true" underline="true"/>
0624             <itemData name="Section Title" defStyleNum="dsString" bold="true"/>
0625             <itemData name="Strong" defStyleNum="dsNormal" bold="true"/>
0626             <itemData name="Subscript" defStyleNum="dsNormal" underline="true"/>
0627             <itemData name="Superscript" defStyleNum="dsNormal" bold="true" underline="true"/>
0628             <itemData name="Verbatim" defStyleNum="dsDocumentation"/>
0629         </itemDatas>
0630     </highlighting>
0631 
0632     <general>
0633         <comments>
0634             <comment name="singleLine" start="//"/>
0635             <comment name="multiLine" start="////" end="////" region="comment"/>
0636         </comments>
0637         <keywords casesensitive="1"/>
0638     </general>
0639 </language>
0640 <!-- kate: replace-tabs on; tab-width 4; indent-width 4; -->