mirror of
https://github.com/chinchang/web-maker.git
synced 2025-10-11 11:34:24 +02:00
rename jad to pug. fixes #78
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
})(function(CodeMirror) {
|
||||
"use strict";
|
||||
|
||||
CodeMirror.defineMode('jade', function (config) {
|
||||
CodeMirror.defineMode("pug", function (config) {
|
||||
// token types
|
||||
var KEYWORD = 'keyword';
|
||||
var DOCTYPE = 'meta';
|
||||
@@ -36,7 +36,7 @@ CodeMirror.defineMode('jade', function (config) {
|
||||
this.isInterpolating = false;
|
||||
this.interpolationNesting = 0;
|
||||
|
||||
this.jsState = jsMode.startState();
|
||||
this.jsState = CodeMirror.startState(jsMode);
|
||||
|
||||
this.restOfLine = '';
|
||||
|
||||
@@ -386,7 +386,7 @@ CodeMirror.defineMode('jade', function (config) {
|
||||
if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) {
|
||||
if (stream.peek() === '=' || stream.peek() === '!') {
|
||||
state.inAttributeName = false;
|
||||
state.jsState = jsMode.startState();
|
||||
state.jsState = CodeMirror.startState(jsMode);
|
||||
if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') {
|
||||
state.attributeIsType = true;
|
||||
} else {
|
||||
@@ -492,7 +492,7 @@ CodeMirror.defineMode('jade', function (config) {
|
||||
if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) {
|
||||
if (state.innerMode) {
|
||||
if (!state.innerState) {
|
||||
state.innerState = state.innerMode.startState ? state.innerMode.startState(stream.indentation()) : {};
|
||||
state.innerState = state.innerMode.startState ? CodeMirror.startState(state.innerMode, stream.indentation()) : {};
|
||||
}
|
||||
return stream.hideFirstChars(state.indentOf + 2, function () {
|
||||
return state.innerMode.token(stream, state.innerState) || true;
|
||||
@@ -585,6 +585,7 @@ CodeMirror.defineMode('jade', function (config) {
|
||||
};
|
||||
}, 'javascript', 'css', 'htmlmixed');
|
||||
|
||||
CodeMirror.defineMIME('text/x-jade', 'jade');
|
||||
CodeMirror.defineMIME('text/x-pug', 'pug');
|
||||
CodeMirror.defineMIME('text/x-jade', 'pug');
|
||||
|
||||
});
|
Reference in New Issue
Block a user