diff options
Diffstat (limited to 'lexers/LexHTML.cxx')
-rw-r--r-- | lexers/LexHTML.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx index a20796387..d8d4d2e9c 100644 --- a/lexers/LexHTML.cxx +++ b/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; |