Sha256: df19ec9db9544674a97199c90a490c90a48cfc623c3236e55c89141cf84b27f8
Contents?: true
Size: 1.77 KB
Versions: 11
Compression:
Stored size: 1.77 KB
Contents
/* global define */ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; function pop2(currentState, stack) { stack.splice(0, 3); return stack.shift() || "start"; } var HandlebarsHighlightRules = function() { HtmlHighlightRules.call(this); var hbs = { regex : "(?={{)", push : "handlebars" }; for (var key in this.$rules) { this.$rules[key].unshift(hbs); } this.$rules.handlebars = [{ token : "comment.start", regex : "{{!--", push : [{ token : "comment.end", regex : "--}}", next : pop2 }, { defaultToken : "comment" }] }, { token : "comment.start", regex : "{{!", push : [{ token : "comment.end", regex : "}}", next : pop2 }, { defaultToken : "comment" }] }, { token : "support.function", // unescaped variable regex : "{{{", push : [{ token : "support.function", regex : "}}}", next : pop2 }, { token : "variable.parameter", regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" }] }, { token : "storage.type.start", // begin section regex : "{{[#\\^/&]?", push : [{ token : "storage.type.end", regex : "}}", next : pop2 }, { token : "variable.parameter", regex : "[a-zA-Z_$][a-zA-Z0-9_$]*" }] }]; this.normalizeRules(); }; oop.inherits(HandlebarsHighlightRules, HtmlHighlightRules); exports.HandlebarsHighlightRules = HandlebarsHighlightRules; });
Version data entries
11 entries across 11 versions & 3 rubygems