| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language [ |
| 3 |
<!ENTITY name "[A-Za-z][A-Za-z0-9_-]*"> |
| 4 |
<!ENTITY voidtag "(area|base|br|col|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)"> |
| 5 |
<!ENTITY entity "&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9_-]*);"> |
| 6 |
]> |
| 7 |
<!-- |
| 8 |
|
| 9 |
Pug, known as Jade before, is a HTML template engine. |
| 10 |
|
| 11 |
https://pugjs.org/ |
| 12 |
|
| 13 |
Changelog |
| 14 |
|
| 15 |
Version 1 - Guo Yunhe [email protected] - 2017-04-14 |
| 16 |
- Basic Pug/Jade syntax support |
| 17 |
- Do NOT support multi-line comment or text block |
| 18 |
|
| 19 |
--> |
| 20 |
<language name="Pug" version="8" kateversion="5.53" section="Markup" extensions="*.pug;*.jade" mimetype="" priority="10" author="Guo Yunhe ([email protected])" license="LGPL"> |
| 21 |
<highlighting> |
| 22 |
<list name="controlflow"> |
| 23 |
<item>case</item> |
| 24 |
<item>when</item> |
| 25 |
<item>default</item> |
| 26 |
<item>if</item> |
| 27 |
<item>unless</item> |
| 28 |
<item>else</item> |
| 29 |
<item>each</item> |
| 30 |
<item>while</item> |
| 31 |
</list> |
| 32 |
<contexts> |
| 33 |
<context name="Start" attribute="Normal Text" lineEndContext="#stay"> |
| 34 |
<RegExpr attribute="Comment" context="BlockComment" String="^(\s*)//" column="0"/> |
| 35 |
<Detect2Chars attribute="Comment" context="Comment" char="/" char1="/"/> |
| 36 |
<StringDetect attribute="Doctype" context="#stay" String="doctype" insensitive="true"/> |
| 37 |
<RegExpr attribute="ControlFlow" context="JavaScript" String="\belse\s+if\b" firstNonSpace="true"/> |
| 38 |
<keyword attribute="ControlFlow" context="JavaScript" String="controlflow" firstNonSpace="true"/> |
| 39 |
<DetectIdentifier attribute="Normal Text" context="Element" firstNonSpace="true" lookAhead="true"/> |
| 40 |
<AnyChar attribute="Normal Text" context="Element" String="#." firstNonSpace="true" lookAhead="true"/> |
| 41 |
<DetectChar attribute="Normal Text" context="JavaScript" char="-" firstNonSpace="true"/> |
| 42 |
<DetectChar attribute="Normal Text" context="#stay" char="|" firstNonSpace="true"/> |
| 43 |
</context> |
| 44 |
<context name="FindInterpolation" attribute="Normal Text" lineEndContext="#stay"> |
| 45 |
<Detect2Chars attribute="Interpolation" context="JavaScript" char="#" char1="{"/> |
| 46 |
<DetectChar attribute="Interpolation" context="#stay" char="}"/> |
| 47 |
</context> |
| 48 |
<context name="FindEntities" attribute="Normal Text" lineEndContext="#stay"> |
| 49 |
<RegExpr attribute="Entity" context="#stay" String="&entity;"/> |
| 50 |
<AnyChar attribute="Error" context="#stay" String="&<"/> |
| 51 |
</context> |
| 52 |
<context name="Element" attribute="Normal Text" lineEndContext="#pop"> |
| 53 |
<RegExpr attribute="Element" context="#stay" String="&name;"/> |
| 54 |
<RegExpr attribute="ID" context="#stay" String="#&name;"/> |
| 55 |
<RegExpr attribute="Class" context="#stay" String="\.&name;"/> |
| 56 |
<DetectChar attribute="Normal Text" context="Attributes" char="("/> |
| 57 |
<StringDetect attribute="Normal Text" context="AttributeObject" String="&attributes("/> |
| 58 |
<RegExpr attribute="Normal Text" context="Element" String=":\s+"/> |
| 59 |
<RegExpr attribute="Normal Text" context="JavaScript" String="=\s+"/> |
| 60 |
<DetectChar attribute="Normal Text" context="Text" char=" "/> |
| 61 |
</context> |
| 62 |
<context name="Attributes" attribute="Normal Text" lineEndContext="#stay"> |
| 63 |
<RegExpr attribute="Attribute" context="Attribute" String="(&name;|\(&name;\))"/> |
| 64 |
<DetectChar attribute="Normal Text" context="#pop" char=")"/> |
| 65 |
</context> |
| 66 |
<context name="AttributeObject" attribute="Normal Text" lineEndContext="#stay"> |
| 67 |
<DetectChar attribute="Normal Text" context="#pop" char=")"/> |
| 68 |
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/> |
| 69 |
</context> |
| 70 |
<context name="Attribute" attribute="Attribute" lineEndContext="#pop"> |
| 71 |
<AnyChar attribute="Normal Text" context="#pop" String=",)" lookAhead="true"/> |
| 72 |
<RegExpr attribute="Attribute" context="#pop" String="\s+(&name;|\(&name;\))(=|\s|\))" lookAhead="true"/> |
| 73 |
<DetectChar attribute="Attribute" context="Value" char="="/> |
| 74 |
</context> |
| 75 |
<context name="Value" attribute="Normal Text" lineEndContext="#pop"> |
| 76 |
<AnyChar attribute="Normal Text" context="#pop" String=",)" lookAhead="true"/> |
| 77 |
<RegExpr attribute="Attribute" context="#pop" String="\s+(&name;|\(&name;\))(=|\s|\))" lookAhead="true"/> |
| 78 |
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/> |
| 79 |
</context> |
| 80 |
<context name="Text" attribute="Normal Text" lineEndContext="#pop"> |
| 81 |
<DetectSpaces/> |
| 82 |
<IncludeRules context="FindEntities" includeAttrib="true"/> |
| 83 |
<IncludeRules context="FindInterpolation" includeAttrib="true"/> |
| 84 |
</context> |
| 85 |
<context name="JavaScript" attribute="Normal Text" lineEndContext="#pop"> |
| 86 |
<IncludeRules context="Normal##JavaScript" includeAttrib="true"/> |
| 87 |
<AnyChar attribute="Normal Text" context="#pop" String=",)}:" lookAhead="true"/> |
| 88 |
</context> |
| 89 |
<context name="Comment" attribute="Comment" lineEndContext="#pop"> |
| 90 |
<DetectSpaces /> |
| 91 |
<IncludeRules context="##Comments"/> |
| 92 |
</context> |
| 93 |
<context name="BlockComment" attribute="Comment" lineEndContext="#stay"> |
| 94 |
<RegExpr attribute="Comment" context="#stay" String="^%1\s" column="0" dynamic="true"/> |
| 95 |
<RegExpr attribute="Comment" context="#stay" String="^\s*$" column="0"/> |
| 96 |
<RegExpr attribute="Comment" context="#pop" String="." lookAhead="true" column="0"/> |
| 97 |
<IncludeRules context="Comment"/> |
| 98 |
</context> |
| 99 |
</contexts> |
| 100 |
<itemDatas> |
| 101 |
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> |
| 102 |
<itemData name="ControlFlow" defStyleNum="dsControlFlow" spellChecking="false"/> |
| 103 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 104 |
<itemData name="Doctype" defStyleNum="dsDataType" bold="1" spellChecking="false"/> |
| 105 |
<itemData name="Element" defStyleNum="dsKeyword" spellChecking="false"/> |
| 106 |
<itemData name="ID" defStyleNum="dsPreprocessor" spellChecking="false"/> |
| 107 |
<itemData name="Class" defStyleNum="dsFunction" spellChecking="false"/> |
| 108 |
<itemData name="Attribute" defStyleNum="dsAttribute" spellChecking="false"/> |
| 109 |
<itemData name="Entity" defStyleNum="dsDecVal" spellChecking="false"/> |
| 110 |
<itemData name="Interpolation" defStyleNum="dsPreprocessor" spellChecking="false"/> |
| 111 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/> |
| 112 |
</itemDatas> |
| 113 |
</highlighting> |
| 114 |
<general> |
| 115 |
<keywords casesensitive="1" weakDeliminator="-"/> |
| 116 |
<comments> |
| 117 |
<comment name="singleLine" start="//" position="afterwhitespace"/> |
| 118 |
</comments> |
| 119 |
<folding indentationsensitive="1"/> |
| 120 |
<emptyLines> |
| 121 |
<emptyLine regexpr="\s+"/> |
| 122 |
<emptyLine regexpr="\s*//.*"/> |
| 123 |
</emptyLines> |
| 124 |
</general> |
| 125 |
</language> |
| 126 |
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; --> |