Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/mustache.xml
Show All 36 Lines | 15 | ================================================================ | |||
---|---|---|---|---|---|
37 | 37 | | |||
38 | Change log: | 38 | Change log: | ||
39 | * v3 [2019-10-03]: Minor fixes. | 39 | * v3 [2019-10-03]: Minor fixes. | ||
40 | * v2 [2019-02-24]: Also highlight template files (HTML). | 40 | * v2 [2019-02-24]: Also highlight template files (HTML). | ||
41 | Improve support for Handlebars. | 41 | Improve support for Handlebars. | ||
42 | * v1 [2019-02-10]: Initial version | 42 | * v1 [2019-02-10]: Initial version | ||
43 | --> | 43 | --> | ||
44 | 44 | | |||
45 | <language name="Mustache/Handlebars (HTML)" version="3" kateversion="5.44" | 45 | <language name="Mustache/Handlebars (HTML)" version="4" kateversion="5.44" | ||
46 | section="Markup" priority="1" mimetype="" | 46 | section="Markup" priority="1" mimetype="" | ||
47 | extensions="*.mustache;*.handlebars;*.hbs;*.ractive;*.hogan;*.hulk;*.html.mst;*.html.mu;*.html.rac" | 47 | extensions="*.mustache;*.handlebars;*.hbs;*.ractive;*.hogan;*.hulk;*.html.mst;*.html.mu;*.html.rac" | ||
48 | author="Nibaldo González (nibgonz@gmail.com), based on the HTML highlighter by Wilbert Berendsen (wilbert@kde.nl)" | 48 | author="Nibaldo González (nibgonz@gmail.com), based on the HTML highlighter by Wilbert Berendsen (wilbert@kde.nl)" | ||
49 | license="MIT"> | 49 | license="MIT"> | ||
50 | 50 | | |||
51 | <highlighting> | 51 | <highlighting> | ||
52 | 52 | | |||
53 | <contexts> | 53 | <contexts> | ||
Show All 25 Lines | 78 | <context name="MustacheVariables" attribute="Normal Text" lineEndContext="#stay"> | |||
79 | <StringDetect context="#stay" attribute="Normal Text" String="\{{" /> | 79 | <StringDetect context="#stay" attribute="Normal Text" String="\{{" /> | ||
80 | <Detect2Chars context="StartMustacheVariable" char="{" char1="{" lookAhead="true" /> | 80 | <Detect2Chars context="StartMustacheVariable" char="{" char1="{" lookAhead="true" /> | ||
81 | </context> | 81 | </context> | ||
82 | <context name="StartMustacheVariable" attribute="Normal Text" lineEndContext="#stay"> | 82 | <context name="StartMustacheVariable" attribute="Normal Text" lineEndContext="#stay"> | ||
83 | <!-- Escaped --> | 83 | <!-- Escaped --> | ||
84 | <RegExpr context="#pop!MustacheRawBlockContent" attribute="Mustache Block" String="\{{4}[^/].*\}{4}" minimal="true" beginRegion="HandlebarsRawBlock" /> | 84 | <RegExpr context="#pop!MustacheRawBlockContent" attribute="Mustache Block" String="\{{4}[^/].*\}{4}" minimal="true" beginRegion="HandlebarsRawBlock" /> | ||
85 | <!-- Sections --> | 85 | <!-- Sections --> | ||
86 | <!-- For helpers (not included because it's redundant): | 86 | <!-- For helpers (not included because it's redundant): | ||
87 | Start: \{\{~?#?\s*(?=(if|unless|with|link\-to|each(\-in)?)\b) | 87 | Start: \{\{~?#?\s*(?=(?:if|unless|with|link\-to|each(?:\-in)?)\b) | ||
88 | End: \{\{~?/\s*(?=(if|unless|with|link\-to|each(\-in)?)\b) --> | 88 | End: \{\{~?/\s*(?=(?:if|unless|with|link\-to|each(?:\-in)?)\b) --> | ||
89 | <RegExpr context="#pop!MustacheVariableBlock" attribute="Mustache Block" String="\{\{~?\s*else(?:\s+(?:if|unless|with|link\-to|each(?:\-in)?))?\b" /> | 89 | <RegExpr context="#pop!MustacheVariableBlock" attribute="Mustache Block" String="\{\{~?\s*else(?:\s+(?:if|unless|with|link\-to|each(?:\-in)?))?\b" /> | ||
90 | <RegExpr context="#pop!MustacheVariableBlock" attribute="Mustache Block" String="\{\{~?[#\^][>\*]?\s*&identifier;\b" beginRegion="MustacheBlock" /> | 90 | <RegExpr context="#pop!MustacheVariableBlock" attribute="Mustache Block" String="\{\{~?[#\^][>\*]?\s*&identifier;\b" beginRegion="MustacheBlock" /> | ||
91 | <RegExpr context="#pop" attribute="Mustache Block" String="\{\{~?/\s*&identifier;\s*\}\}" endRegion="MustacheBlock" /> | 91 | <RegExpr context="#pop" attribute="Mustache Block" String="\{\{~?/\s*&identifier;\s*\}\}" endRegion="MustacheBlock" /> | ||
92 | <RegExpr context="#pop!MustacheVariableBlockEndFolding" attribute="Mustache Block" String="\{\{~?/\s*&identifier;\b" /> | 92 | <RegExpr context="#pop!MustacheVariableBlockEndFolding" attribute="Mustache Block" String="\{\{~?/\s*&identifier;\b" /> | ||
93 | <RegExpr context="#pop!MustacheVariableBlock" attribute="Mustache Block" String="\{\{~?[#\^/]" /> | 93 | <RegExpr context="#pop!MustacheVariableBlock" attribute="Mustache Block" String="\{\{~?[#\^/]" /> | ||
94 | <!-- Comments --> | 94 | <!-- Comments --> | ||
95 | <StringDetect context="#pop!MustacheBlockComment" attribute="Comment" String="{{!--" beginRegion="MustacheBlockComment" /> <!-- Handlebars --> | 95 | <StringDetect context="#pop!MustacheBlockComment" attribute="Comment" String="{{!--" beginRegion="MustacheBlockComment" /> <!-- Handlebars --> | ||
96 | <StringDetect context="#pop!MustacheInlineComment" attribute="Comment" String="{{!" beginRegion="MustacheInlineComment" /> | 96 | <StringDetect context="#pop!MustacheInlineComment" attribute="Comment" String="{{!" beginRegion="MustacheInlineComment" /> | ||
▲ Show 20 Lines • Show All 361 Lines • ▼ Show 20 Line(s) | 429 | <itemDatas> | |||
458 | <itemData name="JS: Template" defStyleNum="dsVerbatimString" /> | 458 | <itemData name="JS: Template" defStyleNum="dsVerbatimString" /> | ||
459 | <itemData name="JS: Substitution" defStyleNum="dsSpecialChar" spellChecking="false" /> | 459 | <itemData name="JS: Substitution" defStyleNum="dsSpecialChar" spellChecking="false" /> | ||
460 | </itemDatas> | 460 | </itemDatas> | ||
461 | 461 | | |||
462 | </highlighting> | 462 | </highlighting> | ||
463 | 463 | | |||
464 | <general> | 464 | <general> | ||
465 | <comments> | 465 | <comments> | ||
466 | <comment name="multiLine" start="{{!" end="}}" /> | 466 | <comment name="multiLine" start="{{!" end="}}" region="MustacheInlineComment" /> | ||
467 | </comments> | 467 | </comments> | ||
468 | </general> | 468 | </general> | ||
469 | 469 | | |||
470 | </language> | 470 | </language> | ||
471 | <!-- kate: replace-tabs off; tab-width 3; indent-width 3; remove-trailing-spaces mod; dynamic-word-wrap off; --> | 471 | <!-- kate: replace-tabs off; tab-width 3; indent-width 3; remove-trailing-spaces mod; dynamic-word-wrap off; --> |