diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx
index 5be39664..b093e6ae 100644
--- a/scintilla/lexers/LexHTML.cxx
+++ b/scintilla/lexers/LexHTML.cxx
@@ -884,7 +884,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
(chNext == '?') &&
!IsScriptCommentState(state)) {
beforeLanguage = scriptLanguage;
- scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, eScriptPHP);
+ scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, isXml ? eScriptXML : eScriptPHP);
if (scriptLanguage != eScriptPHP && isStringState(state)) continue;
styler.ColourTo(i - 1, StateToPrint);
beforePreProc = state;