aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/LexHTML.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx
index a3d883ab8..9bec3a214 100644
--- a/src/LexHTML.cxx
+++ b/src/LexHTML.cxx
@@ -642,6 +642,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
if (inScriptType == eNonHtmlScript && state == SCE_H_COMMENT) {
scriptLanguage = eScriptComment;
}
+ script_type beforeLanguage = ScriptOfState(beforePreProc);
// property fold.html
// Folding is turned on or off for HTML and XML files with this option.
@@ -948,7 +949,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
}
// handle the start Django template code
- else if (isDjango && scriptLanguage == eScriptNone && (ch == '{' && (chNext == '%' || chNext == '{'))) {
+ else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' || chNext == '{'))) {
if (chNext == '%')
strcpy(djangoBlockType, "%");
else
@@ -963,6 +964,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
i += 1;
visibleChars += 1;
state = SCE_HP_START;
+ beforeLanguage = scriptLanguage;
scriptLanguage = eScriptPython;
styler.ColourTo(i, SCE_H_ASP);
if (foldHTMLPreprocessor && chNext == '%')
@@ -1096,7 +1098,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
if (foldHTMLPreprocessor) {
levelCurrent--;
}
- scriptLanguage = eScriptNone;
+ scriptLanguage = beforeLanguage;
continue;
}