diff options
Diffstat (limited to 'scintilla/lexers/LexHTML.cxx')
-rw-r--r-- | scintilla/lexers/LexHTML.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx index d20d688..5fe4746 100644 --- a/scintilla/lexers/LexHTML.cxx +++ b/scintilla/lexers/LexHTML.cxx @@ -261,28 +261,29 @@ static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &k static int classifyTagHTML(unsigned int start, unsigned int end,
WordList &keywords, Accessor &styler, bool &tagDontFold,
bool caseSensitive, bool isXml, bool allowScripts) {
- char s[30 + 2];
+ char withSpace[30 + 2] = " ";
+ const char *s = withSpace + 1;
// Copy after the '<'
- unsigned int i = 0;
+ unsigned int i = 1;
for (unsigned int cPos = start; cPos <= end && i < 30; cPos++) {
char ch = styler[cPos];
if ((ch != '<') && (ch != '/')) {
- s[i++] = caseSensitive ? ch : static_cast<char>(MakeLowerCase(ch));
+ withSpace[i++] = caseSensitive ? ch : static_cast<char>(MakeLowerCase(ch));
}
}
//The following is only a quick hack, to see if this whole thing would work
//we first need the tagname with a trailing space...
- s[i] = ' ';
- s[i+1] = '\0';
+ withSpace[i] = ' ';
+ withSpace[i+1] = '\0';
// if the current language is XML, I can fold any tag
// if the current language is HTML, I don't want to fold certain tags (input, meta, etc.)
//...to find it in the list of no-container-tags
- tagDontFold = (!isXml) && (NULL != strstr("meta link img area br hr input ", s));
+ tagDontFold = (!isXml) && (NULL != strstr(" area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr ", withSpace));
//now we can remove the trailing space
- s[i] = '\0';
+ withSpace[i] = '\0';
// No keywords -> all are known
char chAttr = SCE_H_TAGUNKNOWN;
|