| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!-- |
| 3 |
Kate syntax highlight filter for Markdown/MultiMarkdown documents. |
| 4 |
|
| 5 |
Copyright 2008 Darrin Yeager. http://www.dyeager.org/ |
| 6 |
Dual-Licensed under both GPL and BSD licenses. |
| 7 |
|
| 8 |
Extended 2009 Claes Holmerson. http://github.com/claes/kate-markdown/ |
| 9 |
Extended 2019 Nibaldo González S. <[email protected]> (changes under MIT license). |
| 10 |
--> |
| 11 |
<!-- |
| 12 |
The [^\s]{1} is in the regex to avoid interfering with bullet list which |
| 13 |
starts "* item". Thus emphasis/strong MUST be formed like *words here* |
| 14 |
with the asterisks next to the beginning of the first word. |
| 15 |
|
| 16 |
Match space or newline, followed by "*", followed by one non-space, |
| 17 |
followed by anything non-asterisk, followed by "*", followed by |
| 18 |
space, end-of-sentence punctuation, or the end of the line. |
| 19 |
|
| 20 |
TODO: We can be more specific and highlight text combinations in bold, |
| 21 |
italic and strikethrough. |
| 22 |
Example: **bold text and _italic and bold text_** |
| 23 |
__bold and ~~strikeout and bold~~__ |
| 24 |
--> |
| 25 |
<!DOCTYPE language |
| 26 |
[ |
| 27 |
<!-- NOTE: To correctly detect bold, italic or strike out text, use minimal="true" in RegExpr rules --> |
| 28 |
<!ENTITY contentregex_ast "(?:(?:[^\*\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^\*\s\\]|\\\S)"> |
| 29 |
<!ENTITY contentregex_und "(?:(?:[^_\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^_\s\\]|\\\S)"> |
| 30 |
<!-- strong + emphasis text --> |
| 31 |
<!ENTITY strongemphasisregex_ast "\*{3,5}&contentregex_ast;\*{3}"> |
| 32 |
<!ENTITY strongemphasisregex_und "\b_{3,5}&contentregex_und;_{3}"> |
| 33 |
<!ENTITY strongemphasisregex_ast_und "\*{2,5}(?:(?:_|_{3}|_{5})&contentregex_und;_+|(?:_{2}|_{4})&contentregex_und;_)\*{2}"> |
| 34 |
<!ENTITY strongemphasisregex_ast_und2 "\*_{2,5}&contentregex_und;_{2,5}\*(?!\*)"> |
| 35 |
<!ENTITY strongemphasisregex_und_ast "\b_{2,5}(?:(?:\*|\*{3}|\*{5})&contentregex_ast;\*+|(?:\*{2}|\*{4})&contentregex_ast;\*)_{2}"> |
| 36 |
<!ENTITY strongemphasisregex_und_ast2 "\b_(?:\*{2,5}&contentregex_ast;\*{2,5}_{0,4}|_{0,4}\*{2,5}&contentregex_ast;\*{2,5})_\b"> |
| 37 |
<!-- strong text --> |
| 38 |
<!ENTITY strongregex_ast "\*{2}(?:&contentregex_ast;\*{2}|\*{1,3}&contentregex_ast;\*{2}(?!\*))"> |
| 39 |
<!ENTITY strongregex_und "\b_{2}(?:&contentregex_und;_{2}|_{1,3}&contentregex_und;_{2}(?!_))"> |
| 40 |
<!-- emphasis text --> |
| 41 |
<!ENTITY emphasisregex_ast "\*(?:&contentregex_ast;\*|\*{1,4}&contentregex_ast;\*(?!\*))"> |
| 42 |
<!ENTITY emphasisregex_und "\b_(?:&contentregex_und;_+|_{1,4}&contentregex_und;_)\b"> |
| 43 |
<!-- links. |
| 44 |
Keep in sync with reStructuredText (rest) --> |
| 45 |
<!ENTITY startlink "(?:https?|ftp)\://"> |
| 46 |
<!ENTITY link "&startlink;[^">\s]+"> |
| 47 |
<!-- link in normal text. |
| 48 |
Keep in sync with reStructuredText’s (rest) StandaloneHyperlink attribute --> |
| 49 |
<!ENTITY implicitlink "\b&startlink;[^">\s`\)]*[^\s!"'`\(\)\*,\.:;<>\?~\]\}\\](?=[[:punct:]]*(?:[\s\)]|$))"> |
| 50 |
<!-- references: [name], [name][id], [name][id] "title", [name](https://example.com) --> |
| 51 |
<!ENTITY refchar "(?:\\.|[^\]\\])"> |
| 52 |
<!ENTITY refname "(?:\\.|[^\s\[\]\\])&refchar;*"> |
| 53 |
<!ENTITY reflinkid "\s*(?:&refname;)?"> |
| 54 |
<!ENTITY reflinkidregex "(?:\s?\[&reflinkid;\]|\((?:\\.|[^\(\)\\])*\))"> |
| 55 |
<!ENTITY reflinkregex "\[(?:(?=\s*&refname;\])|\s+(?=\]))"> |
| 56 |
<!-- target ref.: [id]: https://example.com "Title" --> |
| 57 |
<!ENTITY reflinktargetregex '\[\s*(?:&refname;|\s)\]\:\s+(?=\S)'> |
| 58 |
<!-- footnote: [^name] --> |
| 59 |
<!ENTITY footnoteregex "\[\^&refchar;+\]"> |
| 60 |
<!-- image: , ![title][id] --> |
| 61 |
<!ENTITY startinlineimage "\!\[(?:\\.|[^\[\]\\])*\]\("> |
| 62 |
<!ENTITY endinlineimage "(?:\\.|[^\(\)\\])*\)"> |
| 63 |
<!ENTITY inlineimageregex "&startinlineimage;(?=&endinlineimage;)"> |
| 64 |
<!ENTITY refimageregex "\!\[(?:\\.|[^\[\]\\])*\]\[&reflinkid;\]"> |
| 65 |
<!-- autolink & email: <https://example.com>, <[email protected]>, <mailto:[email protected]> --> |
| 66 |
<!ENTITY autolinkregex '<&link;>'> |
| 67 |
<!ENTITY email "[\-\.\w]+\@[\-a-z0-9]+(?:\.[\-a-z0-9]+)*\.[a-z]+"> |
| 68 |
<!ENTITY mailtolinkregex "<(?:mailto:)?(?=&email;>)"> |
| 69 |
<!-- horizontal rule: avoid conflicts with strong-emphasis text, lists and code blocks --> |
| 70 |
<!ENTITY rulerregex "\s*(?:(?:\*\s*){3,}|(?:_\s*){3,}|(?:\-\s*){3,})\s*$"> |
| 71 |
<!-- two spaces at end of line generates linebreak --> |
| 72 |
<!ENTITY linebreakregex " $"> |
| 73 |
<!-- strikethrough text, pandoc style --> |
| 74 |
<!ENTITY strikeoutregex "[~]{2}[^~](?:.*[^~])?[~]{2}"> |
| 75 |
<!-- start of fenced code block --> |
| 76 |
<!ENTITY fcode "(`{3,}|~{3,})"> |
| 77 |
<!-- end of line & empty line --> |
| 78 |
<!ENTITY end "\s*$"> |
| 79 |
<!ENTITY emptyline "^\s*$"> |
| 80 |
<!-- indented code block --> |
| 81 |
<!ENTITY indentedcodeblock "(?:\s{4}|\t).*$"> |
| 82 |
<!-- bullet of list --> |
| 83 |
<!ENTITY listbullet "[\*\+\-]"> |
| 84 |
<!-- metadata key & name of html tag --> |
| 85 |
<!ENTITY metadatakey "[a-zA-Z0-9][\w\-\s]*\:"> |
| 86 |
<!ENTITY htmlname "[A-Za-z_\:][\w\.\:\-]*"> |
| 87 |
<!-- comment --> |
| 88 |
<!ENTITY startcomment "<!--"> |
| 89 |
<!ENTITY endcomment "-->"> |
| 90 |
<!ENTITY checkbox "\[[ x]\](?=\s)"> |
| 91 |
]> |
| 92 |
|
| 93 |
<language name="Markdown" version="26" kateversion="5.79" section="Markup" extensions="*.md;*.mmd;*.markdown" mimetype="text/markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD"> |
| 94 |
<highlighting> |
| 95 |
<contexts> |
| 96 |
<!-- Start of the Markdown document: find metadata or code block --> |
| 97 |
<context name="Start Document" attribute="Normal Text" lineEndContext="Normal Text" lineEmptyContext="Normal Text" fallthroughContext="Normal Text"> |
| 98 |
<!-- Some titles: (Title|Author|Date|Copyright|Revision|CSS|LaTeX\ XSLT|Categories|Tags|BaseName|Excerpt) --> |
| 99 |
<!-- Metadata: Markdown format --> |
| 100 |
<RegExpr attribute="Metadata" context="metadata" String="^\-{3}&end;" column="0" beginRegion="metadata"/> |
| 101 |
<!-- Metadata: MultiMarkdown format --> |
| 102 |
<RegExpr attribute="Metadata Title" context="metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/> |
| 103 |
<!-- Code Block --> |
| 104 |
<RegExpr attribute="Code" context="find-code-block-start" String="^&indentedcodeblock;" column="0"/> |
| 105 |
</context> |
| 106 |
<context name="metadata" attribute="Metadata" lineEndContext="#stay"> |
| 107 |
<StringDetect attribute="Metadata" context="#pop!Normal Text" String="---" column="0" endRegion="metadata"/> |
| 108 |
<StringDetect attribute="Metadata" context="#pop!Normal Text" String="..." column="0" endRegion="metadata"/> |
| 109 |
<RegExpr attribute="Metadata Title" String="^&metadatakey;(?=\s|$)" column="0"/> |
| 110 |
</context> |
| 111 |
<context name="metadata-mm-value" attribute="Metadata" lineEndContext="#pop!metadata-mm"/> |
| 112 |
<context name="metadata-mm" attribute="Metadata" lineEndContext="#stay" lineEmptyContext="#pop!Normal Text" fallthroughContext="#pop!Normal Text"> |
| 113 |
<!-- Find Metadata key or value --> |
| 114 |
<RegExpr attribute="Metadata Title" context="#pop!metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/> |
| 115 |
<RegExpr attribute="Metadata" context="#pop!metadata-mm-value" String="^(?:\s{4}|\t)" column="0"/> |
| 116 |
</context> |
| 117 |
<context name="find-code-block-start" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthroughContext="#pop!Normal Text"> |
| 118 |
<IncludeRules context="find-code-block"/> |
| 119 |
</context> |
| 120 |
|
| 121 |
<!-- Normal Text Document --> |
| 122 |
<context name="Normal Text" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="find-code-block"> |
| 123 |
<!-- Header --> |
| 124 |
<DetectChar context="find-header" char="#" column="0" lookAhead="true"/> |
| 125 |
<RegExpr attribute="Header H1" String="(?:\=\s*){2,}$" firstNonSpace="true"/> |
| 126 |
<!-- Highlight code block after line only with spaces or comment --> |
| 127 |
<RegExpr attribute="Normal Text" context="find-code-block" String="&emptyline;" column="0"/> |
| 128 |
<StringDetect attribute="Comment" context="find-code-block" String="&startcomment;" column="0" lookAhead="true"/> |
| 129 |
<!-- Horizontal rules, Blockquotes and Lists. |
| 130 |
NOTE: The indentation of the lists is captured. --> |
| 131 |
<RegExpr attribute="Horizontal Rule" context="find-code-block" String="^&rulerregex;" column="0"/> |
| 132 |
<DetectChar attribute="Blockquote" context="blockquote" char=">" firstNonSpace="true"/> |
| 133 |
<RegExpr attribute="List" context="list" String="^(\s*)&listbullet;(\s+)" column="0"/> |
| 134 |
<RegExpr attribute="Number List" context="numlist" String="^(\s*)\d\.(\s+)" column="0"/> |
| 135 |
<RegExpr attribute="Number List" context="numlist2" String="^(\s*)\d\d+\.(\s+)" column="0"/> |
| 136 |
<!-- Find Strong, Emphasis and Strikethrough Text --> |
| 137 |
<DetectChar context="find-strong-normal" char="*" lookAhead="true"/> |
| 138 |
<DetectChar context="find-emphasis-normal" char="_" lookAhead="true"/> |
| 139 |
<RegExpr attribute="Strikethrough Text" minimal="true" String="&strikeoutregex;"/> |
| 140 |
<!-- Common --> |
| 141 |
<IncludeRules context="inc"/> |
| 142 |
<RegExpr attribute="Normal Text: Link" String="&implicitlink;"/> |
| 143 |
</context> |
| 144 |
<!-- Find indented code blocks. These are only allowed after an empty line or on the first line --> |
| 145 |
<context name="find-code-block" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthroughContext="#pop"> |
| 146 |
<RegExpr attribute="Code" String="^&indentedcodeblock;" column="0"/> |
| 147 |
<RegExpr attribute="Normal Text" String="&end;" /> |
| 148 |
<RegExpr attribute="Comment" context="comment" String="^\s*&startcomment;|\s*&startcomment;(?=.*&endcomment;)" beginRegion="comment"/> |
| 149 |
</context> |
| 150 |
|
| 151 |
<context name="find-header" attribute="Normal Text" lineEndContext="#pop"> |
| 152 |
<RegExpr attribute="Header H1" context="#pop!close-H2-region" String="^#\s" column="0" endRegion="H1" beginRegion="H1" lookAhead="true"/> |
| 153 |
<RegExpr attribute="Header H2" context="#pop!close-H3-region" String="^##\s" column="0" endRegion="H2" beginRegion="H2" lookAhead="true"/> |
| 154 |
<RegExpr attribute="Header H3" context="#pop!close-H4-region" String="^###\s" column="0" endRegion="H3" beginRegion="H3" lookAhead="true"/> |
| 155 |
<RegExpr attribute="Header H4" context="#pop!close-H5-region" String="^####\s" column="0" endRegion="H4" beginRegion="H4" lookAhead="true"/> |
| 156 |
<RegExpr attribute="Header H5" context="#pop!close-H6-region" String="^#####\s" column="0" endRegion="H5" beginRegion="H5" lookAhead="true"/> |
| 157 |
<RegExpr attribute="Header H6" context="#pop" String="^######\s.*" column="0" endRegion="H6" beginRegion="H6"/> |
| 158 |
<DetectChar attribute="Normal Text" context="#pop" char="#"/> |
| 159 |
</context> |
| 160 |
<!-- BUG: 441278 sub-headers should be closed when their parent header is closed (e.g. in h1 h2 h3 h1, h1-h3 should all be closed at the 2nd h1) --> |
| 161 |
<!-- TODO: Port to a less hacky version (maybe a new attribute for declaring multiple endRegions) --> |
| 162 |
<context name="close-H2-region" attribute="Header H2" lineEndContext="#pop!close-H3-region" fallthroughContext="#pop!close-H3-region"> |
| 163 |
<DetectChar attribute="Header H2" context="#pop!close-H3-region" char="#" lookAhead="true" endRegion="H2"/> |
| 164 |
</context> |
| 165 |
<context name="close-H3-region" attribute="Header H3" lineEndContext="#pop!close-H4-region" fallthroughContext="#pop!close-H4-region"> |
| 166 |
<DetectChar attribute="Header H3" context="#pop!close-H4-region" char="#" lookAhead="true" endRegion="H3"/> |
| 167 |
</context> |
| 168 |
<context name="close-H4-region" attribute="Header H4" lineEndContext="#pop!close-H5-region" fallthroughContext="#pop!close-H5-region"> |
| 169 |
<DetectChar attribute="Header H4" context="#pop!close-H5-region" char="#" lookAhead="true" endRegion="H4"/> |
| 170 |
</context> |
| 171 |
<context name="close-H5-region" attribute="Header H5" lineEndContext="#pop!close-H6-region" fallthroughContext="#pop!close-H6-region"> |
| 172 |
<DetectChar attribute="Header H5" context="#pop!close-H6-region" char="#" lookAhead="true" endRegion="H5"/> |
| 173 |
</context> |
| 174 |
<context name="close-H6-region" attribute="Header H6" lineEndContext="#pop" fallthroughContext="#pop"> |
| 175 |
<DetectChar attribute="Header H6" context="#pop!close-sentinel-region" char="#" lookAhead="true" endRegion="H6"/> |
| 176 |
</context> |
| 177 |
<!-- This sentinel does not close any actual region, it's just here so that the proper attribute/highlighting is applied and --> |
| 178 |
<!--to ensure that H6 headers won't be set as the "primary" region that was closed just because it was closed last --> |
| 179 |
<context name="close-sentinel-region" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 180 |
<RegExpr attribute="Header H1" context="#pop" String="^#\s.*" column="0"/> |
| 181 |
<RegExpr attribute="Header H2" context="#pop" String="^##\s.*" column="0"/> |
| 182 |
<RegExpr attribute="Header H3" context="#pop" String="^###\s.*" column="0"/> |
| 183 |
<RegExpr attribute="Header H4" context="#pop" String="^####\s.*" column="0"/> |
| 184 |
<RegExpr attribute="Header H5" context="#pop" String="^#####\s.*" column="0"/> |
| 185 |
</context> |
| 186 |
|
| 187 |
|
| 188 |
<context name="find-strong-normal" attribute="Normal Text" lineEndContext="#pop"> |
| 189 |
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_ast_und2;"/> |
| 190 |
<RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/> |
| 191 |
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/> |
| 192 |
<RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;"/> |
| 193 |
<DetectChar attribute="Normal Text" context="#pop" char="*"/> |
| 194 |
</context> |
| 195 |
<context name="find-emphasis-normal" attribute="Normal Text" lineEndContext="#pop"> |
| 196 |
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;|&strongemphasisregex_und_ast2;"/> |
| 197 |
<RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/> |
| 198 |
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/> |
| 199 |
<RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/> |
| 200 |
<DetectChar attribute="Normal Text" context="#pop" char="_"/> |
| 201 |
</context> |
| 202 |
|
| 203 |
<!-- Blockquote --> |
| 204 |
<context name="blockquote" attribute="Blockquote: Normal Text" lineEndContext="#stay" lineEmptyContext="#pop"> |
| 205 |
<IncludeRules context="default-blockquote-1"/> |
| 206 |
<!-- Find code block --> |
| 207 |
<RegExpr attribute="Normal Text" context="#pop!find-code-block" String="&emptyline;" column="0"/> |
| 208 |
<StringDetect attribute="Comment" context="#pop!find-code-block" String="&startcomment;" column="0" lookAhead="true"/> |
| 209 |
<IncludeRules context="default-blockquote-2"/> |
| 210 |
</context> |
| 211 |
<!-- Blockquote within a list --> |
| 212 |
<context name="blockquote-list" attribute="Blockquote: Normal Text" lineEndContext="#stay" lineEmptyContext="#pop"> |
| 213 |
<IncludeRules context="default-blockquote-1"/> |
| 214 |
<!-- Don't find code block --> |
| 215 |
<RegExpr attribute="Normal Text" context="#pop" String="&emptyline;" column="0"/> |
| 216 |
<StringDetect attribute="Comment" context="#pop!comment" String="&startcomment;" firstNonSpace="true"/> |
| 217 |
<IncludeRules context="default-blockquote-2"/> |
| 218 |
</context> |
| 219 |
|
| 220 |
<context name="default-blockquote-1" attribute="Blockquote: Normal Text" lineEndContext="#stay"> |
| 221 |
<DetectChar attribute="Blockquote" char=">" firstNonSpace="true"/> |
| 222 |
<!-- End with header, horizontal rule or list/numlist --> |
| 223 |
<RegExpr context="#pop" String="^(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s|&rulerregex;)" column="0" lookAhead="true"/> |
| 224 |
</context> |
| 225 |
<context name="default-blockquote-2" attribute="Blockquote: Normal Text" lineEndContext="#stay"> |
| 226 |
<!-- Strong, emphasis, strong-emphasis and strikethrough text --> |
| 227 |
<AnyChar context="find-strong-emphasis-blockquote" String="*_" lookAhead="true"/> |
| 228 |
<RegExpr attribute="Blockquote: Strikethrough Text" minimal="true" String="&strikeoutregex;"/> |
| 229 |
<!-- Common --> |
| 230 |
<IncludeRules context="inc"/> |
| 231 |
<RegExpr attribute="Blockquote: Link" String="&implicitlink;"/> |
| 232 |
</context> |
| 233 |
<context name="find-strong-emphasis-blockquote" attribute="Blockquote: Normal Text" lineEndContext="#pop"> |
| 234 |
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_und_ast;|&strongemphasisregex_ast_und2;|&strongemphasisregex_und_ast2;"/> |
| 235 |
<RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;|&strongregex_und;"/> |
| 236 |
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;|&strongemphasisregex_und;"/> |
| 237 |
<RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;|&emphasisregex_und;"/> |
| 238 |
<AnyChar attribute="Blockquote: Normal Text" context="#pop" String="*_"/> |
| 239 |
</context> |
| 240 |
|
| 241 |
<!-- List and Numbered List --> |
| 242 |
<!-- NOTE: The indentation of the lists is captured. New paragraphs, code blocks, blockquotes or |
| 243 |
horizontal rules must have an indentation equal to or greater than the list, to be part of it. --> |
| 244 |
<!-- * list --> |
| 245 |
<context name="list" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list"> |
| 246 |
<!-- Find indented code blocks, blockquotes and horizontal rules --> |
| 247 |
<RegExpr attribute="Code" String="^%1%2\s&indentedcodeblock;" column="0" dynamic="true"/> |
| 248 |
<RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s+>" column="0" dynamic="true"/> |
| 249 |
<RegExpr attribute="Horizontal Rule" String="^%1%2\s+&rulerregex;" column="0" dynamic="true"/> |
| 250 |
<RegExpr String="&emptyline;" column="0"/> |
| 251 |
<!-- Text with the same indentation captured corresponds to the item list --> |
| 252 |
<RegExpr context="content-list" String="^%1%2\s" column="0" lookAhead="true" dynamic="true"/> |
| 253 |
<!-- Finish when the text has a lower indentation than the list --> |
| 254 |
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/> |
| 255 |
<!-- Highlight checkbox at the start of the item (task list) --> |
| 256 |
<RegExpr attribute="List: Checkbox" context="content-list" String="\s*&checkbox;"/> |
| 257 |
</context> |
| 258 |
<!-- 1. numlist (one digit) --> |
| 259 |
<context name="numlist" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list"> |
| 260 |
<!-- Find indented code blocks, blockquotes and horizontal rules --> |
| 261 |
<RegExpr attribute="Code" String="^%1%2\s{2}&indentedcodeblock;" column="0" dynamic="true"/> |
| 262 |
<RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s{2,}>" column="0" dynamic="true"/> |
| 263 |
<RegExpr attribute="Horizontal Rule" String="^%1%2\s{2,}&rulerregex;" column="0" dynamic="true"/> |
| 264 |
<RegExpr String="&emptyline;" column="0"/> |
| 265 |
<!-- Text with the same indentation captured --> |
| 266 |
<RegExpr context="content-list" String="^%1%2\s{2}" column="0" lookAhead="true" dynamic="true"/> |
| 267 |
<!-- Finish when the text has a lower indentation than the list --> |
| 268 |
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/> |
| 269 |
</context> |
| 270 |
<!-- 10. numlist (two or more digits) --> |
| 271 |
<context name="numlist2" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list"> |
| 272 |
<!-- Find indented code blocks, blockquotes and horizontal rules --> |
| 273 |
<RegExpr attribute="Code" String="^%1%2\s{3}&indentedcodeblock;" column="0" dynamic="true"/> |
| 274 |
<RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s{3,}>" column="0" dynamic="true"/> |
| 275 |
<RegExpr attribute="Horizontal Rule" String="^%1%2\s{3,}&rulerregex;" column="0" dynamic="true"/> |
| 276 |
<RegExpr String="&emptyline;" column="0"/> |
| 277 |
<!-- Text with the same indentation captured --> |
| 278 |
<RegExpr context="content-list" String="^%1%2\s{3}" column="0" lookAhead="true" dynamic="true"/> |
| 279 |
<!-- Finish when the text has a lower indentation than the list --> |
| 280 |
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/> |
| 281 |
</context> |
| 282 |
|
| 283 |
<!-- NOTE: Empty lines, blockquotes and horizontal rules send to contexts "list", "numlist" or "numlist2" (#pop), |
| 284 |
to check the indentation of the text and determine if the content of the list ends. --> |
| 285 |
<context name="content-list" attribute="List: Normal Text" lineEndContext="#stay" lineEmptyContext="#pop"> |
| 286 |
<RegExpr context="#pop" String="&emptyline;" column="0"/> |
| 287 |
<!-- Blockquote and horzontal rule (check indentation) --> |
| 288 |
<RegExpr context="#pop" String="^\s*(?:>|&rulerregex;)" column="0" lookAhead="true"/> |
| 289 |
<!-- End with header or new list/numlist --> |
| 290 |
<RegExpr context="#pop#pop" String="^(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s)" column="0" lookAhead="true"/> |
| 291 |
<!-- Strong, emphasis, strong-emphasis and strikethrough text --> |
| 292 |
<AnyChar context="find-strong-emphasis-list" String="*_" lookAhead="true"/> |
| 293 |
<RegExpr attribute="List: Strikethrough Text" minimal="true" String="&strikeoutregex;"/> |
| 294 |
<!-- Common --> |
| 295 |
<IncludeRules context="inc"/> |
| 296 |
<RegExpr attribute="List: Link" String="&implicitlink;"/> |
| 297 |
</context> |
| 298 |
<context name="find-strong-emphasis-list" attribute="List: Normal Text" lineEndContext="#pop"> |
| 299 |
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_und_ast;|&strongemphasisregex_ast_und2;|&strongemphasisregex_und_ast2;"/> |
| 300 |
<RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;|&strongregex_und;"/> |
| 301 |
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;|&strongemphasisregex_und;"/> |
| 302 |
<RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;|&emphasisregex_und;"/> |
| 303 |
<AnyChar attribute="List: Normal Text" context="#pop" String="*_"/> |
| 304 |
</context> |
| 305 |
|
| 306 |
<!-- Comments --> |
| 307 |
<context name="comment" attribute="Comment" lineEndContext="#stay"> |
| 308 |
<StringDetect attribute="Comment" context="#pop" String="&endcomment;" endRegion="comment"/> |
| 309 |
<IncludeRules context="##Comments"/> |
| 310 |
</context> |
| 311 |
|
| 312 |
<!-- Fenced Code Blocks --> |
| 313 |
<context name="find-lang-fenced-code" attribute="Normal Text" lineEndContext="#pop"> |
| 314 |
<!-- Apply syntax highlighting to fenced code blocks for some languages --> |
| 315 |
<RegExpr attribute="Fenced Code" context="#pop!code" String="&fcode;&end;"/> |
| 316 |
<RegExpr attribute="Fenced Code" context="#pop!bash-code" String="&fcode;\s*(?:bash(?:rc|_profile|_login|_logout)?|shell|sh|profile|PKGBUILD|APKBUILD|ebuild|eclass|nix)&end;" insensitive="true"/> |
| 317 |
<RegExpr attribute="Fenced Code" context="#pop!zsh-code" String="&fcode;\s*(?:zsh)&end;" insensitive="true"/> |
| 318 |
<RegExpr attribute="Fenced Code" context="#pop!cpp-code" String="&fcode;\s*(?:[ch]pp|[ch]\+\+|[ch]xx|h?cc|hh|cuh?|ino|pde|moc)&end;" insensitive="true"/> |
| 319 |
<RegExpr attribute="Fenced Code" context="#pop!csharp-code" String="&fcode;\s*(?:cs|csharp|c\#)&end;" insensitive="true"/> |
| 320 |
<RegExpr attribute="Fenced Code" context="#pop!cmake-code" String="&fcode;\s*(?:cmake|CMakeLists(?:\.txt)?)&end;" insensitive="true"/> |
| 321 |
<RegExpr attribute="Fenced Code" context="#pop!css-code" String="&fcode;\s*css&end;" insensitive="true"/> |
| 322 |
<RegExpr attribute="Fenced Code" context="#pop!c-code" String="&fcode;\s*[ch]&end;" insensitive="true"/> |
| 323 |
<RegExpr attribute="Fenced Code" context="#pop!doxygen-code" String="&fcode;\s*doxygen&end;" insensitive="true"/> <!-- Block comment of Doxygen --> |
| 324 |
<RegExpr attribute="Fenced Code" context="#pop!email-code" String="&fcode;\s*(?:email|emlx?|mbo?x)&end;" insensitive="true"/> |
| 325 |
<RegExpr attribute="Fenced Code" context="#pop!go-code" String="&fcode;\s*go(?:lang)?&end;" insensitive="true"/> |
| 326 |
<RegExpr attribute="Fenced Code" context="#pop!hamlet-code" String="&fcode;\s*[wxs]?hamlet&end;" insensitive="true"/> <!-- Included in the Haskell definition --> |
| 327 |
<RegExpr attribute="Fenced Code" context="#pop!haskell-code" String="&fcode;\s*(?:haskell|c?hs|hs\-boot)&end;" insensitive="true"/> |
| 328 |
<RegExpr attribute="Fenced Code" context="#pop!html-code" String="&fcode;\s*(?:[sx]?html?|inc|tmpl|tpl)&end;" insensitive="true"/> |
| 329 |
<RegExpr attribute="Fenced Code" context="#pop!java-code" String="&fcode;\s*(?:java|bsh)&end;" insensitive="true"/> |
| 330 |
<RegExpr attribute="Fenced Code" context="#pop!javascript-code" String="&fcode;\s*(?:javascript|m?js|es6|kwinscript|julius)&end;" insensitive="true"/> |
| 331 |
<RegExpr attribute="Fenced Code" context="#pop!jsx-code" String="&fcode;\s*(?:jsx|tsx|(?:java|type)script\-react)&end;" insensitive="true"/> <!-- Included in the HTML definition. Also apply for TSX. --> |
| 332 |
<RegExpr attribute="Fenced Code" context="#pop!json-code" String="&fcode;\s*(?:json5?|gltf)&end;" insensitive="true"/> |
| 333 |
<RegExpr attribute="Fenced Code" context="#pop!yaml-code" String="&fcode;\s*(?:ya?ml)&end;" insensitive="true"/> |
| 334 |
<RegExpr attribute="Fenced Code" context="#pop!matlab-code" String="&fcode;\s*matlab&end;" insensitive="true"/> |
| 335 |
<RegExpr attribute="Fenced Code" context="#pop!markdown-code" String="&fcode;\s*(?:markdown|m?md)&end;" insensitive="true"/> |
| 336 |
<RegExpr attribute="Fenced Code" context="#pop!mustache-code" String="&fcode;\s*(?:handlebars|hbs|mustache|mst|ractive|hogan|hulk)&end;" insensitive="true"/> <!-- Included in the HTML definition --> |
| 337 |
<RegExpr attribute="Fenced Code" context="#pop!perl-code" String="&fcode;\s*(?:perl|p[lm]|pod|psgi|vcl)&end;" insensitive="true"/> |
| 338 |
<RegExpr attribute="Fenced Code" context="#pop!php-code" String="&fcode;\s*(?:php[3457t]?|wml|phtml?|aw|ctp)&end;" insensitive="true"/> |
| 339 |
<RegExpr attribute="Fenced Code" context="#pop!python-code" String="&fcode;\s*(?:python[23]?|py[23w]?|[rc]py|sconstruct|gypi?)&end;" insensitive="true"/> |
| 340 |
<RegExpr attribute="Fenced Code" context="#pop!qml-code" String="&fcode;\s*qml(?:types)?&end;" insensitive="true"/> |
| 341 |
<RegExpr attribute="Fenced Code" context="#pop!r-code" String="&fcode;\s*(?:r|rprofile|rscript)&end;" insensitive="true"/> |
| 342 |
<RegExpr attribute="Fenced Code" context="#pop!raku-code" String="&fcode;\s*(?:raku(?:mod|doc|test)?|perl6|p[lm]?6|pod6|nqp)&end;" insensitive="true"/> |
| 343 |
<RegExpr attribute="Fenced Code" context="#pop!rest-code" String="&fcode;\s*(?:rst|rest|restructuredtext)&end;" insensitive="true"/> <!-- Included in the CMake definition --> |
| 344 |
<RegExpr attribute="Fenced Code" context="#pop!ruby-code" String="&fcode;\s*(?:ruby|rbx?|rjs|rake|f?cgi|gemspec|irbrc|ru|prawn|Appraisals|(?:Rake|Cap|Chef|Gem|Guard|Hobo|Vagrant||Rant|Berks|Thor|Puppet)file|rxml|(?:xml|js)\.erb)&end;" insensitive="true"/> |
| 345 |
<RegExpr attribute="Fenced Code" context="#pop!rust-code" String="&fcode;\s*(?:rust|rs)&end;" insensitive="true"/> |
| 346 |
<RegExpr attribute="Fenced Code" context="#pop!mysql-code" String="&fcode;\s*(?:mysql|sql|ddl)&end;" insensitive="true"/> <!-- Included in the PHP definition --> |
| 347 |
<RegExpr attribute="Fenced Code" context="#pop!nim-code" String="&fcode;\s*(?:nims?)&end;" insensitive="true"/> |
| 348 |
<RegExpr attribute="Fenced Code" context="#pop!typescript-code" String="&fcode;\s*(?:typescript|ts)&end;" insensitive="true"/> |
| 349 |
<RegExpr attribute="Fenced Code" context="#pop!xml-code" String="&fcode;\s*(?:xml|xsd|xspf|tld|jsp|c?pt|dtml|rss|opml|svg|daml|rdf|ui|kcfg|qrc|wsdl|scxml|xbel|dae|sch|brd|docbook)&end;" insensitive="true"/> |
| 350 |
<RegExpr attribute="Fenced Code" context="#pop!code" String="&fcode;.*$"/> |
| 351 |
</context> |
| 352 |
<context name="code" attribute="Code" lineEndContext="#stay"> <!-- Unknown language --> |
| 353 |
<RegExpr attribute="Fenced Code" context="#pop" String="%1[~`]*(?=&end;)" firstNonSpace="true" dynamic="true" endRegion="code-block"/> |
| 354 |
</context> |
| 355 |
<context attribute="Normal Text" lineEndContext="#stay" name="bash-code" fallthroughContext="Command##Bash"> |
| 356 |
<IncludeRules context="code"/> |
| 357 |
<IncludeRules context="##Bash" includeAttrib="true"/> |
| 358 |
</context> |
| 359 |
<context attribute="Normal Text" lineEndContext="#stay" name="zsh-code" fallthroughContext="Command##Zsh"> |
| 360 |
<IncludeRules context="code"/> |
| 361 |
<IncludeRules context="##Zsh" includeAttrib="true"/> |
| 362 |
</context> |
| 363 |
<context attribute="Normal Text" lineEndContext="#stay" name="cmake-code"> |
| 364 |
<IncludeRules context="code"/> |
| 365 |
<IncludeRules context="##CMake" includeAttrib="true"/> |
| 366 |
</context> |
| 367 |
<context attribute="Normal Text" lineEndContext="#stay" name="c-code"> |
| 368 |
<IncludeRules context="code"/> |
| 369 |
<IncludeRules context="##C" includeAttrib="true"/> |
| 370 |
</context> |
| 371 |
<context attribute="Normal Text" lineEndContext="#stay" name="cpp-code"> |
| 372 |
<IncludeRules context="code"/> |
| 373 |
<IncludeRules context="##C++" includeAttrib="true"/> |
| 374 |
</context> |
| 375 |
<context attribute="Normal Text" lineEndContext="#stay" name="csharp-code"> |
| 376 |
<IncludeRules context="code"/> |
| 377 |
<IncludeRules context="##C#" includeAttrib="true"/> |
| 378 |
</context> |
| 379 |
<context attribute="Normal Text" lineEndContext="#stay" name="css-code"> |
| 380 |
<IncludeRules context="code"/> |
| 381 |
<IncludeRules context="##CSS" includeAttrib="true"/> |
| 382 |
</context> |
| 383 |
<context attribute="Normal Text" lineEndContext="#stay" name="doxygen-code"> |
| 384 |
<IncludeRules context="code"/> |
| 385 |
<IncludeRules context="BlockComment##Doxygen" includeAttrib="true"/> |
| 386 |
</context> |
| 387 |
<context attribute="Normal Text" lineEndContext="#stay" name="email-code"> |
| 388 |
<IncludeRules context="code"/> |
| 389 |
<IncludeRules context="##Email" includeAttrib="true"/> |
| 390 |
</context> |
| 391 |
<context attribute="Normal Text" lineEndContext="#stay" name="go-code"> |
| 392 |
<IncludeRules context="code"/> |
| 393 |
<IncludeRules context="##Go" includeAttrib="true"/> |
| 394 |
</context> |
| 395 |
<context attribute="Normal Text" lineEndContext="#stay" name="hamlet-code"> |
| 396 |
<IncludeRules context="code"/> |
| 397 |
<IncludeRules context="##Hamlet" includeAttrib="true"/> |
| 398 |
</context> |
| 399 |
<context attribute="Normal Text" lineEndContext="#stay" name="haskell-code"> |
| 400 |
<IncludeRules context="code"/> |
| 401 |
<IncludeRules context="##Haskell" includeAttrib="true"/> |
| 402 |
</context> |
| 403 |
<context attribute="Normal Text" lineEndContext="#stay" name="html-code"> |
| 404 |
<IncludeRules context="code"/> |
| 405 |
<IncludeRules context="##HTML" includeAttrib="true"/> |
| 406 |
</context> |
| 407 |
<context attribute="Normal Text" lineEndContext="#stay" name="java-code"> |
| 408 |
<IncludeRules context="code"/> |
| 409 |
<IncludeRules context="##Java" includeAttrib="true"/> |
| 410 |
</context> |
| 411 |
<context attribute="Normal Text" lineEndContext="#stay" name="javascript-code"> |
| 412 |
<IncludeRules context="code"/> |
| 413 |
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/> |
| 414 |
</context> |
| 415 |
<context attribute="Normal Text" lineEndContext="#stay" name="jsx-code"> |
| 416 |
<IncludeRules context="code"/> |
| 417 |
<IncludeRules context="Normal##JavaScript React (JSX)" includeAttrib="true"/> |
| 418 |
</context> |
| 419 |
<context attribute="Normal Text" lineEndContext="#stay" name="json-code"> |
| 420 |
<IncludeRules context="code"/> |
| 421 |
<IncludeRules context="##JSON" includeAttrib="true"/> |
| 422 |
</context> |
| 423 |
<context attribute="Normal Text" lineEndContext="#stay" name="yaml-code"> |
| 424 |
<IncludeRules context="code"/> |
| 425 |
<IncludeRules context="##YAML" includeAttrib="true"/> |
| 426 |
</context> |
| 427 |
<context attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="find-code-block" name="markdown-code"> |
| 428 |
<IncludeRules context="code"/> |
| 429 |
<IncludeRules context="Normal Text"/> |
| 430 |
</context> |
| 431 |
<context attribute="Normal Text" lineEndContext="#stay" name="matlab-code"> |
| 432 |
<IncludeRules context="code"/> |
| 433 |
<IncludeRules context="##Matlab" includeAttrib="true"/> |
| 434 |
</context> |
| 435 |
<context attribute="Normal Text" lineEndContext="#stay" name="mustache-code"> |
| 436 |
<IncludeRules context="code"/> |
| 437 |
<IncludeRules context="##Mustache/Handlebars (HTML)" includeAttrib="true"/> |
| 438 |
</context> |
| 439 |
<context attribute="Normal Text" lineEndContext="#stay" name="perl-code"> |
| 440 |
<IncludeRules context="code"/> |
| 441 |
<IncludeRules context="##Perl" includeAttrib="true"/> |
| 442 |
</context> |
| 443 |
<context attribute="Normal Text" lineEndContext="#stay" name="php-code"> |
| 444 |
<IncludeRules context="code"/> |
| 445 |
<IncludeRules context="phpsource##PHP/PHP" includeAttrib="true"/> |
| 446 |
</context> |
| 447 |
<context attribute="Normal Text" lineEndContext="#stay" name="python-code"> |
| 448 |
<IncludeRules context="code"/> |
| 449 |
<IncludeRules context="##Python" includeAttrib="true"/> |
| 450 |
</context> |
| 451 |
<context attribute="Normal Text" lineEndContext="#stay" name="qml-code"> |
| 452 |
<IncludeRules context="code"/> |
| 453 |
<IncludeRules context="Normal##QML" includeAttrib="true"/> |
| 454 |
</context> |
| 455 |
<context attribute="Normal Text" lineEndContext="#stay" name="r-code"> |
| 456 |
<IncludeRules context="code"/> |
| 457 |
<IncludeRules context="##R Script" includeAttrib="true"/> |
| 458 |
</context> |
| 459 |
<context attribute="Normal Text" lineEndContext="#stay" name="raku-code"> |
| 460 |
<IncludeRules context="code"/> |
| 461 |
<IncludeRules context="base##Raku" includeAttrib="true"/> |
| 462 |
</context> |
| 463 |
<context attribute="Normal Text" lineEndContext="#stay" name="rest-code"> |
| 464 |
<IncludeRules context="code"/> |
| 465 |
<IncludeRules context="##reStructuredText" includeAttrib="true"/> |
| 466 |
</context> |
| 467 |
<context attribute="Normal Text" lineEndContext="#stay" name="ruby-code"> |
| 468 |
<IncludeRules context="code"/> |
| 469 |
<IncludeRules context="##Ruby" includeAttrib="true"/> |
| 470 |
</context> |
| 471 |
<context attribute="Normal Text" lineEndContext="#stay" name="rust-code"> |
| 472 |
<IncludeRules context="code"/> |
| 473 |
<IncludeRules context="##Rust" includeAttrib="true"/> |
| 474 |
</context> |
| 475 |
<context attribute="Normal Text" lineEndContext="#stay" name="mysql-code"> |
| 476 |
<IncludeRules context="code"/> |
| 477 |
<IncludeRules context="##SQL (MySQL)" includeAttrib="true"/> |
| 478 |
</context> |
| 479 |
<context attribute="Normal Text" lineEndContext="#stay" name="nim-code"> |
| 480 |
<IncludeRules context="code"/> |
| 481 |
<IncludeRules context="##Nim" includeAttrib="true"/> |
| 482 |
</context> |
| 483 |
<context attribute="Normal Text" lineEndContext="#stay" name="typescript-code"> |
| 484 |
<IncludeRules context="code"/> |
| 485 |
<IncludeRules context="Normal##TypeScript" includeAttrib="true"/> |
| 486 |
</context> |
| 487 |
<context attribute="Normal Text" lineEndContext="#stay" name="xml-code"> |
| 488 |
<IncludeRules context="code"/> |
| 489 |
<IncludeRules context="##XML" includeAttrib="true"/> |
| 490 |
</context> |
| 491 |
|
| 492 |
<!-- Common --> |
| 493 |
<context name="inc" attribute="Normal Text" lineEndContext="#stay"> |
| 494 |
<!-- Code --> |
| 495 |
<RegExpr attribute="Code" String="`[^`]+`(?!`)|`{2}[^`](?:.*?[^`])?`{2}(?!`)|`{3}[^`](?:.*?[^`])?`{3}(?!`)|`{4}[^`](?:.*?[^`])?`{4}(?!`)|`{5,}[^`](?:.*?[^`])?`{5,}"/> |
| 496 |
<!-- Find Fenced Code Block --> |
| 497 |
<RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="`{3,}(?=[^`]*$)|~{3,}(?=[^~]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/> |
| 498 |
<!-- Comment --> |
| 499 |
<StringDetect attribute="Comment" context="comment" String="&startcomment;" beginRegion="comment"/> |
| 500 |
<!-- Links and References --> |
| 501 |
<RegExpr attribute="Reference-Link Target" context="reflinktarget" String="&reflinktargetregex;" firstNonSpace="true"/> |
| 502 |
<RegExpr attribute="Footnote" String="&footnoteregex;"/> |
| 503 |
<RegExpr attribute="Reference-Link" context="find-reflink" String="&reflinkregex;"/> |
| 504 |
<RegExpr attribute="Inline Image" context="inlineimage" String="&inlineimageregex;"/> |
| 505 |
<RegExpr attribute="Reference Image" String="&refimageregex;"/> |
| 506 |
<RegExpr attribute="Auto-Link" context="autolink" String="&autolinkregex;" lookAhead="true"/> |
| 507 |
<RegExpr attribute="Mailto-Link" context="mailtolink" String="&mailtolinkregex;"/> |
| 508 |
<!-- Line Break --> |
| 509 |
<RegExpr attribute="Line Break" minimal="true" String="&linebreakregex;"/> |
| 510 |
<!-- Backslash Escapes --> |
| 511 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="\"/> |
| 512 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="`"/> |
| 513 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="*"/> |
| 514 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="_"/> |
| 515 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="{"/> |
| 516 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="}"/> |
| 517 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="["/> |
| 518 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="]"/> |
| 519 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="("/> |
| 520 |
<Detect2Chars attribute="Backslash Escape" char="\" char1=")"/> |
| 521 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="#"/> |
| 522 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="+"/> |
| 523 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="-"/> |
| 524 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="."/> |
| 525 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="!"/> |
| 526 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="<"/> |
| 527 |
<Detect2Chars attribute="Backslash Escape" char="\" char1=">"/> |
| 528 |
<Detect2Chars attribute="Backslash Escape" char="\" char1="&"/> |
| 529 |
<!-- Inline HTML --> |
| 530 |
<RegExpr attribute="EntityRef" String="&(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&htmlname;);"/> |
| 531 |
<RegExpr context="find-html-block" String="</?&htmlname;(?:[\s>]|/>|$)" lookAhead="true"/> |
| 532 |
</context> |
| 533 |
<context name="find-html-block" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 534 |
<IncludeRules context="FindSpecialHTMLTags##HTML"/> |
| 535 |
<IncludeRules context="FindHTMLTags##HTML"/> |
| 536 |
</context> |
| 537 |
|
| 538 |
<!-- Links and email: <https://example.com>, <[email protected]> --> |
| 539 |
<context name="autolink" attribute="Auto-Link" lineEndContext="#pop" fallthroughContext="#pop"> |
| 540 |
<DetectChar attribute="Auto-Link" char="<"/> |
| 541 |
<DetectChar attribute="Auto-Link" context="#pop" char=">"/> |
| 542 |
<RegExpr attribute="Link" String="&startlink;[^">\s]+"/> |
| 543 |
</context> |
| 544 |
<context name="mailtolink" attribute="Email" lineEndContext="#pop"> |
| 545 |
<DetectChar attribute="Mailto-Link" context="#pop" char=">"/> |
| 546 |
</context> |
| 547 |
|
| 548 |
<!-- References: [example][id], [example](http://example.com) --> |
| 549 |
<context name="find-reflink" attribute="Reference-Link Name" lineEndContext="#pop"> |
| 550 |
<Detect2Chars attribute="Reference-Link Name" char="\" char1="]"/> |
| 551 |
<RegExpr attribute="Reference-Link" context="#pop!find-reflink-id" String="\](?=&reflinkidregex;)"/> <!-- Find id --> |
| 552 |
<DetectChar attribute="Reference-Link" context="#pop" char="]"/> |
| 553 |
<!-- Image as link or reference --> |
| 554 |
<RegExpr attribute="Inline Image" context="inlineimage" String="&startinlineimage;(?=&endinlineimage;&refchar;*\])"/> |
| 555 |
<RegExpr attribute="Reference Image" String="&refimageregex;(?=&refchar;*\])"/> |
| 556 |
<RegExpr attribute="Reference-Link Name" context="#stay" String="(?:\[(?:\\.|[^\[\]\\])*\](?:\\.|[^\[\]\\])*)+(?=\])" minimal="true"/> |
| 557 |
</context> |
| 558 |
<context name="find-reflink-id" attribute="Reference-Link" lineEndContext="#pop"> |
| 559 |
<DetectSpaces /> |
| 560 |
<!-- Ref.: [an example][id] "Optional title" --> |
| 561 |
<DetectChar attribute="Reference-Link" context="#pop!reflink-id" char="["/> |
| 562 |
<!-- Inline Ref.: [an example](http://example.com/ "Title") --> |
| 563 |
<DetectChar attribute="Reference-Link" context="#pop!reflink-inline-id" char="("/> |
| 564 |
</context> |
| 565 |
<context name="reflink-inline-id" attribute="Reference-Link" lineEndContext="#pop"> |
| 566 |
<Detect2Chars attribute="Reference-Link" char="\" char1=")"/> |
| 567 |
<DetectChar attribute="Reference-Link" context="#pop" char=")"/> |
| 568 |
<RegExpr attribute="Reference-Link: Link" String="\b&startlink;(?:\\.|[^">\s\)\\])+"/> |
| 569 |
<RegExpr attribute="Reference-Link: Email" String="\b&email;\b"/> |
| 570 |
</context> |
| 571 |
<context name="reflink-id" attribute="Reference-Link ID" lineEndContext="#pop"> |
| 572 |
<Detect2Chars attribute="Reference-Link ID" char="\" char1="]"/> |
| 573 |
<DetectChar attribute="Reference-Link" context="#pop!reflink-title" char="]"/> |
| 574 |
<RegExpr attribute="Reference-Link: Link" String="\b&startlink;(?:\\.|[^">\s\]\\])+"/> |
| 575 |
</context> |
| 576 |
<!-- [an example][id] "title" --> |
| 577 |
<context name="reflink-title" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop"> |
| 578 |
<RegExpr attribute="Reference-Link" context="#pop" String="\s+"(?:\\.|[^"\\])*""/> |
| 579 |
</context> |
| 580 |
|
| 581 |
<!-- Target Ref.: [foo]: http://example.com/ "Optional Title Here" --> |
| 582 |
<context name="reflinktarget" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop"> |
| 583 |
<RegExpr attribute="Reference-Link Target: Link" context="#pop!reflinktarget-title" String="\s*&link;(?=\s|$)"/> |
| 584 |
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-link" String="\s*<(?=&link;>(?:\s|$))"/> |
| 585 |
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-title" String="\s*#[\w\.\:\-]+\b"/> |
| 586 |
</context> |
| 587 |
<context name="reflinktarget-link" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop"> |
| 588 |
<DetectChar attribute="Reference-Link Target" context="#pop!reflinktarget-title" char=">"/> |
| 589 |
<RegExpr attribute="Reference-Link Target: Link" String="&link;"/> |
| 590 |
</context> |
| 591 |
<context name="reflinktarget-title" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop"> |
| 592 |
<DetectSpaces attribute="Reference-Link Target"/> |
| 593 |
<RegExpr attribute="Reference-Link Target" context="#pop" String=""(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^\)\\])*\)"/> |
| 594 |
</context> |
| 595 |
|
| 596 |
<!-- Image --> |
| 597 |
<context name="inlineimage" attribute="Inline Image" lineEndContext="#pop"> |
| 598 |
<DetectChar attribute="Inline Image" context="#pop" char=")"/> |
| 599 |
<Detect2Chars attribute="Inline Image" char="\" char1=")"/> |
| 600 |
<RegExpr attribute="Inline Image: Link" String="\b&startlink;(?:\\.|[^">\s\)\\])+"/> |
| 601 |
</context> |
| 602 |
</contexts> |
| 603 |
<itemDatas> |
| 604 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 605 |
<itemData name="Emphasis Text" defStyleNum="dsNormal" italic="true"/> |
| 606 |
<itemData name="Strong Text" defStyleNum="dsNormal" bold="true"/> |
| 607 |
<itemData name="Strong-Emphasis Text" defStyleNum="dsNormal" italic="true" bold="true"/> |
| 608 |
<itemData name="Strikethrough Text" defStyleNum="dsNormal" strikeOut="true"/> |
| 609 |
<itemData name="Normal Text: Link" defStyleNum="dsNormal" underline="true" spellChecking="false"/> |
| 610 |
<itemData name="Horizontal Rule" defStyleNum="dsNormal" bold="true" spellChecking="false"/> |
| 611 |
<itemData name="Line Break" defStyleNum="dsNormal" underline="true" color="#999999" spellChecking="false"/> |
| 612 |
<itemData name="Header H1" defStyleNum="dsFunction" bold="true"/> |
| 613 |
<itemData name="Header H2" defStyleNum="dsFunction" bold="true"/> |
| 614 |
<itemData name="Header H3" defStyleNum="dsFunction" bold="true"/> |
| 615 |
<itemData name="Header H4" defStyleNum="dsFunction" bold="true"/> |
| 616 |
<itemData name="Header H5" defStyleNum="dsFunction" bold="true"/> |
| 617 |
<itemData name="Header H6" defStyleNum="dsFunction" bold="true"/> |
| 618 |
<itemData name="Blockquote" defStyleNum="dsAttribute" spellChecking="false"/> |
| 619 |
<itemData name="Blockquote: Normal Text" defStyleNum="dsAttribute"/> |
| 620 |
<itemData name="Blockquote: Emphasis Text" defStyleNum="dsAttribute" italic="true"/> |
| 621 |
<itemData name="Blockquote: Strong Text" defStyleNum="dsAttribute" bold="true"/> |
| 622 |
<itemData name="Blockquote: Strong-Emphasis Text" defStyleNum="dsAttribute" italic="true" bold="true"/> |
| 623 |
<itemData name="Blockquote: Strikethrough Text" defStyleNum="dsAttribute" strikeOut="true"/> |
| 624 |
<itemData name="Blockquote: Link" defStyleNum="dsAttribute" underline="true" spellChecking="false"/> |
| 625 |
<itemData name="List" defStyleNum="dsSpecialString" bold="1" spellChecking="false"/> |
| 626 |
<itemData name="Number List" defStyleNum="dsSpecialString" spellChecking="false"/> |
| 627 |
<itemData name="List: Normal Text" defStyleNum="dsNormal"/> |
| 628 |
<itemData name="List: Emphasis Text" defStyleNum="dsNormal" italic="true"/> |
| 629 |
<itemData name="List: Strong Text" defStyleNum="dsNormal" bold="true"/> |
| 630 |
<itemData name="List: Strong-Emphasis Text" defStyleNum="dsNormal" italic="true" bold="true"/> |
| 631 |
<itemData name="List: Strikethrough Text" defStyleNum="dsNormal" strikeOut="true"/> |
| 632 |
<itemData name="List: Link" defStyleNum="dsNormal" underline="true" spellChecking="false"/> |
| 633 |
<itemData name="List: Checkbox" defStyleNum="dsVariable" spellChecking="false"/> |
| 634 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 635 |
<itemData name="Code" defStyleNum="dsInformation"/> |
| 636 |
<itemData name="Fenced Code" defStyleNum="dsInformation" spellChecking="false"/> |
| 637 |
<itemData name="Auto-Link" defStyleNum="dsOthers" spellChecking="false"/> |
| 638 |
<itemData name="Link" defStyleNum="dsOthers" underline="true" spellChecking="false"/> |
| 639 |
<itemData name="Mailto-Link" defStyleNum="dsOthers" spellChecking="false"/> |
| 640 |
<itemData name="Email" defStyleNum="dsOthers" italic="true" underline="true" spellChecking="false"/> |
| 641 |
<itemData name="Footnote" defStyleNum="dsOthers" italic="true"/> |
| 642 |
<itemData name="Reference-Link" defStyleNum="dsComment" italic="false"/> |
| 643 |
<itemData name="Reference-Link Name" defStyleNum="dsOthers" underline="true" italic="false"/> |
| 644 |
<itemData name="Reference-Link ID" defStyleNum="dsComment" italic="false"/> |
| 645 |
<itemData name="Reference-Link: Link" defStyleNum="dsComment" underline="true" italic="false" spellChecking="false"/> |
| 646 |
<itemData name="Reference-Link: Email" defStyleNum="dsComment" italic="true" underline="true" spellChecking="false"/> |
| 647 |
<itemData name="Reference-Link Target" defStyleNum="dsOthers" italic="false" bold="false"/> |
| 648 |
<itemData name="Reference-Link Target: Link" defStyleNum="dsOthers" underline="true" spellChecking="false"/> |
| 649 |
<itemData name="Inline Image" defStyleNum="dsAlert" italic="false" bold="false"/> |
| 650 |
<itemData name="Reference Image" defStyleNum="dsAlert" italic="false" bold="false"/> |
| 651 |
<itemData name="Inline Image: Link" defStyleNum="dsAlert" italic="false" bold="false" underline="true"/> |
| 652 |
<itemData name="Metadata Title" defStyleNum="dsAnnotation"/> |
| 653 |
<itemData name="Metadata" defStyleNum="dsComment" italic="0"/> |
| 654 |
<itemData name="Backslash Escape" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 655 |
<itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false"/> |
| 656 |
</itemDatas> |
| 657 |
</highlighting> |
| 658 |
<general> |
| 659 |
<keywords additionalDeliminator="`"/> |
| 660 |
<comments> |
| 661 |
<comment name="multiLine" start="&startcomment;" end="&endcomment;" region="comment"/> |
| 662 |
</comments> |
| 663 |
</general> |
| 664 |
</language> |
| 665 |
<!-- kate: replace-tabs on; indent-width 2; tab-width 2; --> |