| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY name "[A-Za-z_:][\w.:_-]*"> |
| 5 |
<!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*"> |
| 6 |
<!ENTITY entref "&(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);"> |
| 7 |
]> |
| 8 |
<language name="HTML" version="15" kateversion="5.53" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm;*.aspx" mimetype="text/html" author="Wilbert Berendsen ([email protected])" license="LGPL" priority="10"> |
| 9 |
|
| 10 |
<highlighting> |
| 11 |
<contexts> |
| 12 |
<context name="Start" attribute="Normal Text" lineEndContext="#stay"> |
| 13 |
<IncludeRules context="FindHTML" /> |
| 14 |
</context> |
| 15 |
|
| 16 |
<context name="FindHTML" attribute="Normal Text" lineEndContext="#stay"> |
| 17 |
<DetectSpaces/> |
| 18 |
<DetectIdentifier/> |
| 19 |
<StringDetect attribute="Comment" context="Comment" String="<!--" beginRegion="comment" /> |
| 20 |
<StringDetect attribute="CDATA" context="CDATA" String="<![CDATA[" beginRegion="cdata" /> |
| 21 |
<RegExpr attribute="Doctype" context="Doctype" String="<!DOCTYPE\s+" insensitive="true" beginRegion="doctype" /> |
| 22 |
<RegExpr attribute="Processing Instruction" context="PI" String="<\?[\w:-]*" beginRegion="pi" /> |
| 23 |
<IncludeRules context="FindSpecialHTMLTags" /> |
| 24 |
<IncludeRules context="FindHTMLTags" /> |
| 25 |
<!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" /> |
| 26 |
<IncludeRules context="FindEntityRefs" /> |
| 27 |
</context> |
| 28 |
|
| 29 |
<!-- This allows you to insert HTML tags in other syntax definitions --> |
| 30 |
<context name="FindSpecialHTMLTags" attribute="Normal Text" lineEndContext="#stay"> |
| 31 |
<RegExpr attribute="Element" context="CSS" String="<style\b" insensitive="true" beginRegion="style" /> |
| 32 |
<RegExpr attribute="Element" context="JS" String="<script\b" insensitive="true" beginRegion="script" /> |
| 33 |
</context> |
| 34 |
|
| 35 |
<context name="FindHTMLTags" attribute="Normal Text" lineEndContext="#stay"> |
| 36 |
<WordDetect attribute="Element" context="El Open" String="<pre" insensitive="true" beginRegion="pre" /> |
| 37 |
<WordDetect attribute="Element" context="El Open" String="<div" insensitive="true" beginRegion="div" /> |
| 38 |
<WordDetect attribute="Element" context="El Open" String="<table" insensitive="true" beginRegion="table" /> |
| 39 |
<WordDetect attribute="Element" context="El Open" String="<ul" insensitive="true" beginRegion="ul" /> |
| 40 |
<WordDetect attribute="Element" context="El Open" String="<ol" insensitive="true" beginRegion="ol" /> |
| 41 |
<WordDetect attribute="Element" context="El Open" String="<dl" insensitive="true" beginRegion="dl" /> |
| 42 |
<WordDetect attribute="Element" context="El Open" String="<article" insensitive="true" beginRegion="article" /> |
| 43 |
<WordDetect attribute="Element" context="El Open" String="<aside" insensitive="true" beginRegion="aside" /> |
| 44 |
<WordDetect attribute="Element" context="El Open" String="<details" insensitive="true" beginRegion="details" /> |
| 45 |
<WordDetect attribute="Element" context="El Open" String="<figure" insensitive="true" beginRegion="figure" /> |
| 46 |
<WordDetect attribute="Element" context="El Open" String="<footer" insensitive="true" beginRegion="footer" /> |
| 47 |
<WordDetect attribute="Element" context="El Open" String="<header" insensitive="true" beginRegion="header" /> |
| 48 |
<WordDetect attribute="Element" context="El Open" String="<main" insensitive="true" beginRegion="main" /> |
| 49 |
<WordDetect attribute="Element" context="El Open" String="<nav" insensitive="true" beginRegion="nav" /> |
| 50 |
<WordDetect attribute="Element" context="El Open" String="<section" insensitive="true" beginRegion="section" /> |
| 51 |
<RegExpr attribute="Element" context="El Open" String="<&name;" /> |
| 52 |
<WordDetect attribute="Element" context="El Close" String="</pre" insensitive="true" endRegion="pre" /> |
| 53 |
<WordDetect attribute="Element" context="El Close" String="</div" insensitive="true" endRegion="div" /> |
| 54 |
<WordDetect attribute="Element" context="El Close" String="</table" insensitive="true" endRegion="table" /> |
| 55 |
<WordDetect attribute="Element" context="El Close" String="</ul" insensitive="true" endRegion="ul" /> |
| 56 |
<WordDetect attribute="Element" context="El Close" String="</ol" insensitive="true" endRegion="ol" /> |
| 57 |
<WordDetect attribute="Element" context="El Close" String="</dl" insensitive="true" endRegion="dl" /> |
| 58 |
<WordDetect attribute="Element" context="El Close" String="</article" insensitive="true" endRegion="article" /> |
| 59 |
<WordDetect attribute="Element" context="El Close" String="</aside" insensitive="true" endRegion="aside" /> |
| 60 |
<WordDetect attribute="Element" context="El Close" String="</details" insensitive="true" endRegion="details" /> |
| 61 |
<WordDetect attribute="Element" context="El Close" String="</figure" insensitive="true" endRegion="figure" /> |
| 62 |
<WordDetect attribute="Element" context="El Close" String="</footer" insensitive="true" endRegion="footer" /> |
| 63 |
<WordDetect attribute="Element" context="El Close" String="</header" insensitive="true" endRegion="header" /> |
| 64 |
<WordDetect attribute="Element" context="El Close" String="</main" insensitive="true" endRegion="main" /> |
| 65 |
<WordDetect attribute="Element" context="El Close" String="</nav" insensitive="true" endRegion="nav" /> |
| 66 |
<WordDetect attribute="Element" context="El Close" String="</section" insensitive="true" endRegion="section" /> |
| 67 |
<RegExpr attribute="Element" context="El Close" String="</&name;" /> |
| 68 |
</context> |
| 69 |
|
| 70 |
<context name="FindEntityRefs" attribute="Other Text" lineEndContext="#stay"> |
| 71 |
<RegExpr attribute="EntityRef" context="#stay" String="&entref;" /> |
| 72 |
<AnyChar attribute="Error" context="#stay" String="&<" /> |
| 73 |
</context> |
| 74 |
|
| 75 |
<context name="FindPEntityRefs" attribute="Other Text" lineEndContext="#stay"> |
| 76 |
<RegExpr attribute="EntityRef" context="#stay" String="&entref;" /> |
| 77 |
<RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" /> |
| 78 |
<AnyChar attribute="Error" context="#stay" String="&%" /> |
| 79 |
</context> |
| 80 |
|
| 81 |
<context name="FindAttributes" attribute="Other Text" lineEndContext="#stay"> |
| 82 |
<RegExpr attribute="Attribute" context="#stay" String="^&attributeName;|\s+&attributeName;" /> |
| 83 |
<DetectChar attribute="Attribute" context="Value" char="=" /> |
| 84 |
</context> |
| 85 |
|
| 86 |
<context name="FindDTDRules" attribute="Other Text" lineEndContext="#stay"> |
| 87 |
<RegExpr attribute="Doctype" context="Doctype Markupdecl" String="<!(?:ELEMENT|ENTITY|ATTLIST|NOTATION)\b" /> |
| 88 |
</context> |
| 89 |
|
| 90 |
|
| 91 |
<context name="Comment" attribute="Comment" lineEndContext="#stay"> |
| 92 |
<DetectSpaces/> |
| 93 |
<StringDetect attribute="Comment" context="#pop" String="-->" endRegion="comment" /> |
| 94 |
<IncludeRules context="##Comments" /> |
| 95 |
<DetectIdentifier/> |
| 96 |
<RegExpr attribute="Error" context="#stay" String="-(?:-(?!->))+" /> |
| 97 |
</context> |
| 98 |
|
| 99 |
<context name="CDATA" attribute="Other Text" lineEndContext="#stay"> |
| 100 |
<DetectSpaces/> |
| 101 |
<DetectIdentifier/> |
| 102 |
<StringDetect attribute="CDATA" context="#pop" String="]]>" endRegion="cdata" /> |
| 103 |
<StringDetect attribute="EntityRef" context="#stay" String="]]&gt;" /> |
| 104 |
</context> |
| 105 |
|
| 106 |
<context name="PI" attribute="Other Text" lineEndContext="#stay"> |
| 107 |
<Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1=">" endRegion="pi" /> |
| 108 |
</context> |
| 109 |
|
| 110 |
<context name="Doctype" attribute="Other Text" lineEndContext="#stay"> |
| 111 |
<DetectChar attribute="Doctype" context="#pop" char=">" endRegion="doctype" /> |
| 112 |
<DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" /> |
| 113 |
</context> |
| 114 |
|
| 115 |
<context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay"> |
| 116 |
<DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" /> |
| 117 |
<IncludeRules context="FindDTDRules" /> |
| 118 |
<StringDetect attribute="Comment" context="Comment" String="<!--" beginRegion="comment" /> |
| 119 |
<RegExpr attribute="Processing Instruction" context="PI" String="<\?[\w:-]*" beginRegion="pi" /> |
| 120 |
<IncludeRules context="FindPEntityRefs" /> |
| 121 |
</context> |
| 122 |
|
| 123 |
<context name="Doctype Markupdecl" attribute="Other Text" lineEndContext="#stay"> |
| 124 |
<DetectChar attribute="Doctype" context="#pop" char=">" /> |
| 125 |
<DetectChar attribute="Value" context="Doctype Markupdecl DQ" char=""" /> |
| 126 |
<DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="'" /> |
| 127 |
</context> |
| 128 |
|
| 129 |
<context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay"> |
| 130 |
<DetectChar attribute="Value" context="#pop" char=""" /> |
| 131 |
<IncludeRules context="FindPEntityRefs" /> |
| 132 |
</context> |
| 133 |
|
| 134 |
<context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay"> |
| 135 |
<DetectChar attribute="Value" context="#pop" char="'" /> |
| 136 |
<IncludeRules context="FindPEntityRefs" /> |
| 137 |
</context> |
| 138 |
|
| 139 |
<context name="El Open" attribute="Other Text" lineEndContext="#stay"> |
| 140 |
<Detect2Chars attribute="Element" context="#pop" char="/" char1=">" /> |
| 141 |
<DetectChar attribute="Element" context="#pop" char=">" /> |
| 142 |
<IncludeRules context="FindAttributes" /> |
| 143 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 144 |
</context> |
| 145 |
|
| 146 |
<context name="El Close" attribute="Other Text" lineEndContext="#stay"> |
| 147 |
<DetectChar attribute="Element" context="#pop" char=">" /> |
| 148 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 149 |
</context> |
| 150 |
|
| 151 |
<context name="El Close 2" attribute="Other Text" lineEndContext="#stay"> |
| 152 |
<DetectChar attribute="Element" context="#pop#pop#pop" char=">" /> |
| 153 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 154 |
</context> |
| 155 |
|
| 156 |
<context name="El Close 3" attribute="Other Text" lineEndContext="#stay"> |
| 157 |
<DetectChar attribute="Element" context="#pop#pop#pop#pop" char=">" /> |
| 158 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 159 |
</context> |
| 160 |
|
| 161 |
<context name="CSS" attribute="Other Text" lineEndContext="#stay"> |
| 162 |
<Detect2Chars attribute="Element" context="#pop" char="/" char1=">" endRegion="style" /> |
| 163 |
<DetectChar attribute="Element" context="CSS content" char=">" /> |
| 164 |
<IncludeRules context="FindAttributes" /> |
| 165 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 166 |
</context> |
| 167 |
|
| 168 |
<context name="CSS content" attribute="Other Text" lineEndContext="#stay"> |
| 169 |
<RegExpr attribute="Element" context="El Close 2" String="</style\b" insensitive="true" endRegion="style" /> |
| 170 |
<IncludeRules context="##CSS" includeAttrib="true"/> |
| 171 |
</context> |
| 172 |
|
| 173 |
<context name="JS" attribute="Other Text" lineEndContext="#stay"> |
| 174 |
<RegExpr attribute="Attribute" context="Script-Type" String="(?:\s+|^)type(?=\=|\s|$)" insensitive="true"/> |
| 175 |
<DetectChar attribute="Element" context="JS content" char=">" /> |
| 176 |
<IncludeRules context="DefaultJS" /> |
| 177 |
</context> |
| 178 |
<context name="DefaultJS" attribute="Other Text" lineEndContext="#stay"> |
| 179 |
<Detect2Chars attribute="Element" context="#pop" char="/" char1=">" endRegion="script" /> |
| 180 |
<IncludeRules context="FindAttributes" /> |
| 181 |
<RegExpr attribute="Error" context="#stay" String="\S" /> |
| 182 |
</context> |
| 183 |
|
| 184 |
<context name="JS content" attribute="Other Text" lineEndContext="#stay"> |
| 185 |
<IncludeRules context="Default JS content"/> |
| 186 |
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/> |
| 187 |
</context> |
| 188 |
<context name="Default JS content" attribute="Other Text" lineEndContext="#stay"> |
| 189 |
<RegExpr attribute="Element" context="El Close 2" String="</script\b" insensitive="true" endRegion="script" /> |
| 190 |
<RegExpr attribute="Comment" context="JS comment close" String="//(?=.*</script\b)" insensitive="true" /> |
| 191 |
</context> |
| 192 |
|
| 193 |
<context name="JS comment close" attribute="Comment" lineEndContext="#pop"> |
| 194 |
<RegExpr attribute="Element" context="El Close 3" String="</script\b" insensitive="true" endRegion="script" /> |
| 195 |
<DetectSpaces /> |
| 196 |
<IncludeRules context="##Comments" /> |
| 197 |
</context> |
| 198 |
|
| 199 |
<context name="Value" attribute="Other Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ"> |
| 200 |
<DetectChar attribute="Value" context="Value DQ" char=""" /> |
| 201 |
<DetectChar attribute="Value" context="Value SQ" char="'" /> |
| 202 |
<DetectSpaces /> |
| 203 |
</context> |
| 204 |
|
| 205 |
<context name="Value NQ" attribute="Other Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop"> |
| 206 |
<IncludeRules context="FindEntityRefs" /> |
| 207 |
<RegExpr attribute="Value" context="#stay" String="/(?!>)|[^/><"'\s]" /> |
| 208 |
</context> |
| 209 |
|
| 210 |
<context name="Value DQ" attribute="Value" lineEndContext="#stay"> |
| 211 |
<DetectChar attribute="Value" context="#pop#pop" char=""" /> |
| 212 |
<IncludeRules context="FindEntityRefs" /> |
| 213 |
</context> |
| 214 |
|
| 215 |
<context name="Value SQ" attribute="Value" lineEndContext="#stay"> |
| 216 |
<DetectChar attribute="Value" context="#pop#pop" char="'" /> |
| 217 |
<IncludeRules context="FindEntityRefs" /> |
| 218 |
</context> |
| 219 |
|
| 220 |
<!-- Read content from the "type" attribute to change the language to |
| 221 |
highlight in the <script> tag. The default language is JavaScript. --> |
| 222 |
|
| 223 |
<context name="Script-Type" attribute="Other Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> |
| 224 |
<DetectSpaces /> |
| 225 |
<DetectChar attribute="Attribute" context="#pop!Script-Type Value" char="=" /> |
| 226 |
</context> |
| 227 |
<context name="Script-Type Value" attribute="Other Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Value"> |
| 228 |
<DetectSpaces /> |
| 229 |
<!-- TypeScript --> |
| 230 |
<StringDetect attribute="Value" context="#pop#pop!TypeScript" String=""text/typescript""/> |
| 231 |
<StringDetect attribute="Value" context="#pop#pop!TypeScript" String="'text/typescript'"/> |
| 232 |
<!-- JSX (JavaScript React) --> |
| 233 |
<StringDetect attribute="Value" context="#pop#pop!JSX" String=""text/jsx""/> |
| 234 |
<StringDetect attribute="Value" context="#pop#pop!JSX" String="'text/jsx'"/> |
| 235 |
<StringDetect attribute="Value" context="#pop#pop!JSX" String=""text/babel""/> |
| 236 |
<StringDetect attribute="Value" context="#pop#pop!JSX" String="'text/babel'"/> |
| 237 |
<!-- MustacheJS / HandlebarsJS / RactiveJS --> |
| 238 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String=""x-tmpl-mustache""/> |
| 239 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String="'x-tmpl-mustache'"/> |
| 240 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String=""text/mustache""/> |
| 241 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String="'text/mustache'"/> |
| 242 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String=""text/x-mustache-template""/> |
| 243 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String="'text/x-mustache-template'"/> |
| 244 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String=""text/x-handlebars-template""/> |
| 245 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String="'text/x-handlebars-template'"/> |
| 246 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String=""text/ractive""/> |
| 247 |
<StringDetect attribute="Value" context="#pop#pop!MustacheJS" String="'text/ractive'"/> |
| 248 |
<!-- HTML templates --> |
| 249 |
<StringDetect attribute="Value" context="#pop#pop!Script HTML template" String=""text/html""/> |
| 250 |
<StringDetect attribute="Value" context="#pop#pop!Script HTML template" String="'text/html'"/> |
| 251 |
</context> |
| 252 |
|
| 253 |
<context name="JSX" attribute="Other Text" lineEndContext="#stay"> |
| 254 |
<DetectChar attribute="Element" context="JSX content" char=">" /> |
| 255 |
<IncludeRules context="DefaultJS" /> |
| 256 |
</context> |
| 257 |
<context name="JSX content" attribute="Other Text" lineEndContext="#stay"> |
| 258 |
<IncludeRules context="Default JS content"/> |
| 259 |
<IncludeRules context="Normal##JavaScript React (JSX)" includeAttrib="true"/> |
| 260 |
</context> |
| 261 |
|
| 262 |
<context name="TypeScript" attribute="Other Text" lineEndContext="#stay"> |
| 263 |
<DetectChar attribute="Element" context="TypeScript content" char=">" /> |
| 264 |
<IncludeRules context="DefaultJS" /> |
| 265 |
</context> |
| 266 |
<context name="TypeScript content" attribute="Other Text" lineEndContext="#stay"> |
| 267 |
<IncludeRules context="Default JS content"/> |
| 268 |
<IncludeRules context="Normal##TypeScript" includeAttrib="true"/> |
| 269 |
</context> |
| 270 |
|
| 271 |
<context name="MustacheJS" attribute="Other Text" lineEndContext="#stay"> |
| 272 |
<DetectChar attribute="Element" context="MustacheJS content" char=">" /> |
| 273 |
<IncludeRules context="DefaultJS" /> |
| 274 |
</context> |
| 275 |
<context name="MustacheJS content" attribute="Other Text" lineEndContext="#stay"> |
| 276 |
<RegExpr attribute="Element" context="El Close 2" String="</script\b" insensitive="true" endRegion="script" /> |
| 277 |
<StringDetect attribute="Error" context="#stay" String="<script>" insensitive="true" /> |
| 278 |
<RegExpr attribute="Error" context="#stay" String="<script\b" insensitive="true" /> |
| 279 |
<IncludeRules context="Base##Mustache/Handlebars (HTML)" includeAttrib="true"/> |
| 280 |
</context> |
| 281 |
|
| 282 |
<context name="Script HTML template" attribute="Other Text" lineEndContext="#stay"> |
| 283 |
<DetectChar attribute="Element" context="Script HTML template content" char=">" /> |
| 284 |
<IncludeRules context="DefaultJS" /> |
| 285 |
</context> |
| 286 |
<context name="Script HTML template content" attribute="Other Text" lineEndContext="#stay"> |
| 287 |
<RegExpr attribute="Element" context="El Close 2" String="</script\b" insensitive="true" endRegion="script" /> |
| 288 |
<StringDetect attribute="Error" context="#stay" String="<script>" insensitive="true" /> |
| 289 |
<RegExpr attribute="Error" context="#stay" String="<script\b" insensitive="true" /> |
| 290 |
<IncludeRules context="FindHTML" /> |
| 291 |
</context> |
| 292 |
|
| 293 |
</contexts> |
| 294 |
<itemDatas> |
| 295 |
<itemData name="Normal Text" defStyleNum="dsNormal" /> |
| 296 |
<itemData name="Other Text" defStyleNum="dsNormal" spellChecking="false" /> |
| 297 |
<itemData name="Comment" defStyleNum="dsComment" /> |
| 298 |
<itemData name="CDATA" defStyleNum="dsBaseN" bold="1" spellChecking="false" /> |
| 299 |
<itemData name="Processing Instruction" defStyleNum="dsKeyword" spellChecking="false" /> |
| 300 |
<itemData name="Doctype" defStyleNum="dsDataType" bold="1" spellChecking="false" /> |
| 301 |
<itemData name="Element" defStyleNum="dsKeyword" spellChecking="false" /> |
| 302 |
<itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false" /> |
| 303 |
<itemData name="Value" defStyleNum="dsString" spellChecking="false" /> |
| 304 |
<itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false" /> |
| 305 |
<itemData name="PEntityRef" defStyleNum="dsDecVal" spellChecking="false" /> |
| 306 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false" /> |
| 307 |
</itemDatas> |
| 308 |
|
| 309 |
</highlighting> |
| 310 |
<general> |
| 311 |
<comments> |
| 312 |
<comment name="multiLine" start="<!--" end="-->" region="comment" /> |
| 313 |
</comments> |
| 314 |
</general> |
| 315 |
</language> |
| 316 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |