aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-07-16 12:12:19 +1000
committerNeil <nyamatongwe@gmail.com>2014-07-16 12:12:19 +1000
commit2d8ad147aeb8db6a107efbb3f0fe621a53e04dad (patch)
tree31c0695fed120ae19e840cdb889fd92f1948aafc
parentbaf2d31068737bf24102cee6a7fed33e0d00d1f3 (diff)
downloadscintilla-mirror-2d8ad147aeb8db6a107efbb3f0fe621a53e04dad.tar.gz
Bug [#1622]. Don't crash with SGML after a Mako comment.
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--lexers/LexHTML.cxx4
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 9dfbe08f0..af074b880 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -481,6 +481,10 @@
"make clean".
</li>
<li>
+ HTML lexer fixes a crash with SGML after a Mako comment.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1622/">Bug #1622</a>.
+ </li>
+ <li>
KiXtart lexer adds a block comment state.
<a href="http://sourceforge.net/p/scintilla/feature-requests/1053/">Feature #1053.</a>
</li>
diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx
index d6b0b31bc..4bc4b765b 100644
--- a/lexers/LexHTML.cxx
+++ b/lexers/LexHTML.cxx
@@ -828,13 +828,15 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
else if (isMako && makoComment && (ch == '\r' || ch == '\n')) {
makoComment = 0;
styler.ColourTo(i, SCE_HP_COMMENTLINE);
- state = SCE_HP_DEFAULT;
}
// Allow falling through to mako handling code if newline is going to end a block
if (((ch == '\r' && chNext != '\n') || (ch == '\n')) &&
(!isMako || (0 != strcmp(makoBlockType, "%")))) {
}
+ // Ignore everything in mako comment until the line ends
+ else if (isMako && makoComment) {
+ }
// generic end of script processing
else if ((inScriptType == eNonHtmlScript) && (ch == '<') && (chNext == '/')) {