From eaa8ccaccb1091820d0a8d1223996a6dd057347d Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sun, 17 Jan 2016 14:28:04 -0600 Subject: Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor --- .../vendor/codemirror/mode/handlebars/handlebars.js | 19 ++++++++++++++----- public/vendor/codemirror/mode/handlebars/index.html | 15 +++------------ 2 files changed, 17 insertions(+), 17 deletions(-) mode change 100755 => 100644 public/vendor/codemirror/mode/handlebars/handlebars.js mode change 100755 => 100644 public/vendor/codemirror/mode/handlebars/index.html (limited to 'public/vendor/codemirror/mode/handlebars') diff --git a/public/vendor/codemirror/mode/handlebars/handlebars.js b/public/vendor/codemirror/mode/handlebars/handlebars.js old mode 100755 new mode 100644 index 40dfea42..2174e538 --- a/public/vendor/codemirror/mode/handlebars/handlebars.js +++ b/public/vendor/codemirror/mode/handlebars/handlebars.js @@ -3,15 +3,15 @@ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); + mod(require("../../lib/codemirror"), require("../../addon/mode/simple"), require("../../addon/mode/multiplex")); else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/simple"], mod); + define(["../../lib/codemirror", "../../addon/mode/simple", "../../addon/mode/multiplex"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; - CodeMirror.defineSimpleMode("handlebars", { + CodeMirror.defineSimpleMode("handlebars-tags", { start: [ { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, { regex: /\{\{!/, push: "comment", token: "comment" }, @@ -21,8 +21,8 @@ { regex: /\}\}/, pop: true, token: "tag" }, // Double and single quotes - { regex: /"(?:[^\\]|\\.)*?"/, token: "string" }, - { regex: /'(?:[^\\]|\\.)*?'/, token: "string" }, + { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" }, + { regex: /'(?:[^\\']|\\.)*'?/, token: "string" }, // Handlebars keywords { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, @@ -49,5 +49,14 @@ ] }); + CodeMirror.defineMode("handlebars", function(config, parserConfig) { + var handlebars = CodeMirror.getMode(config, "handlebars-tags"); + if (!parserConfig || !parserConfig.base) return handlebars; + return CodeMirror.multiplexingMode( + CodeMirror.getMode(config, parserConfig.base), + {open: "{{", close: "}}", mode: handlebars, parseDelimiters: true} + ); + }); + CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); }); diff --git a/public/vendor/codemirror/mode/handlebars/index.html b/public/vendor/codemirror/mode/handlebars/index.html old mode 100755 new mode 100644 index beaef87a..4f82d602 --- a/public/vendor/codemirror/mode/handlebars/index.html +++ b/public/vendor/codemirror/mode/handlebars/index.html @@ -1,4 +1,4 @@ - + CodeMirror: Handlebars mode @@ -61,22 +61,13 @@ - - +

Handlebars syntax highlighting for CodeMirror.

MIME types defined: text/x-handlebars-template

-- cgit v1.2.3