Sha256: 0915fce79505ef8d68dd3800877f11c4bee9b67ba96293609fc453df0b7f16a9
Contents?: true
Size: 1.35 KB
Versions: 262
Compression:
Stored size: 1.35 KB
Contents
CodeMirror.defineMode("jinja2", function(config, parserConf) { var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", "loop", "none", "self", "super", "if", "as", "not", "and", "else", "import", "with", "without", "context"]; keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); function tokenBase (stream, state) { var ch = stream.next(); if (ch == "{") { if (ch = stream.eat(/\{|%|#/)) { stream.eat("-"); state.tokenize = inTag(ch); return "tag"; } } } function inTag (close) { if (close == "{") { close = "}"; } return function (stream, state) { var ch = stream.next(); if ((ch == close || (ch == "-" && stream.eat(close))) && stream.eat("}")) { state.tokenize = tokenBase; return "tag"; } if (stream.match(keywords)) { return "keyword"; } return close == "#" ? "comment" : "string"; }; } return { startState: function () { return {tokenize: tokenBase}; }, token: function (stream, state) { return state.tokenize(stream, state); } }; });
Version data entries
262 entries across 262 versions & 9 rubygems