summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/mode/django/django.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/vendor/codemirror/mode/django/django.js')
-rw-r--r--public/vendor/codemirror/mode/django/django.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/public/vendor/codemirror/mode/django/django.js b/public/vendor/codemirror/mode/django/django.js
index eb8d6591..7b4ef3b5 100644
--- a/public/vendor/codemirror/mode/django/django.js
+++ b/public/vendor/codemirror/mode/django/django.js
@@ -61,16 +61,16 @@
// Ignore completely any stream series that do not match the
// Django template opening tags.
- while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {}
+ while (stream.next() != null && !stream.match(/\{[{%#]/, false)) {}
return null;
}
// A string can be included in either single or double quotes (this is
- // the delimeter). Mark everything as a string until the start delimeter
+ // the delimiter). Mark everything as a string until the start delimiter
// occurs again.
- function inString (delimeter, previousTokenizer) {
+ function inString (delimiter, previousTokenizer) {
return function (stream, state) {
- if (!state.escapeNext && stream.eat(delimeter)) {
+ if (!state.escapeNext && stream.eat(delimiter)) {
state.tokenize = previousTokenizer;
} else {
if (state.escapeNext) {
@@ -80,7 +80,7 @@
var ch = stream.next();
// Take into account the backslash for escaping characters, such as
- // the string delimeter.
+ // the string delimiter.
if (ch == "\\") {
state.escapeNext = true;
}
@@ -100,7 +100,7 @@
return "null";
}
- // Dot folowed by a non-word character should be considered an error.
+ // Dot followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat(".")) {
@@ -119,7 +119,7 @@
return "null";
}
- // Pipe folowed by a non-word character should be considered an error.
+ // Pipe followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat("|")) {
@@ -199,7 +199,7 @@
return "null";
}
- // Dot folowed by a non-word character should be considered an error.
+ // Dot followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat(".")) {
@@ -218,7 +218,7 @@
return "null";
}
- // Pipe folowed by a non-word character should be considered an error.
+ // Pipe followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat("|")) {
@@ -317,9 +317,8 @@
// Mark everything as comment inside the tag and the tag itself.
function inComment (stream, state) {
- if (stream.match("#}")) {
- state.tokenize = tokenBase;
- }
+ if (stream.match(/^.*?#\}/)) state.tokenize = tokenBase
+ else stream.skipToEnd()
return "comment";
}