jade-highlighter
Advanced tools
Comparing version 1.0.4 to 1.0.5
19
index.js
@@ -7,2 +7,3 @@ "use strict" | ||
CodeMirror.loadMode("css"); | ||
CodeMirror.loadMode("xml"); | ||
CodeMirror.loadMode("htmlmixed"); | ||
@@ -90,2 +91,4 @@ CodeMirror.loadMode("markdown"); | ||
this.innerState = null; | ||
this.innerModeForLine = false; | ||
} | ||
@@ -105,3 +108,3 @@ /** | ||
res.interpolationNesting = this.intpolationNesting; | ||
res.jsState = CodeMirror.copyState(jsMode, this.jsState); | ||
@@ -128,2 +131,4 @@ | ||
res.innerModeForLine = this.innerModeForLine; | ||
return res; | ||
@@ -479,2 +484,8 @@ } | ||
} | ||
if (stream.match(/^(<[^\n]*)/, false)) { | ||
// html string | ||
setInnerMode(stream, state, 'htmlmixed'); | ||
state.innerModeForLine = true; | ||
return innerMode(stream, state, true); | ||
} | ||
} | ||
@@ -514,4 +525,4 @@ | ||
} | ||
function innerMode(stream, state) { | ||
if (stream.indentation() > state.indentOf) { | ||
function innerMode(stream, state, force) { | ||
if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { | ||
if (state.innerMode) { | ||
@@ -597,5 +608,5 @@ if (!state.innerState) { | ||
|| indent(stream, state) | ||
|| text(stream, state) | ||
|| comment(stream, state) | ||
|| colon(stream, state) | ||
|| text(stream, state) | ||
|| dot(stream, state) | ||
@@ -602,0 +613,0 @@ || fail(stream, state); |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "1.0.4" | ||
"version": "1.0.5" | ||
} |
20409
558