From b3530f6e2a16c0f8e7c9ab8632f84208706209ea Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 7 May 2007 00:30:27 +0000 Subject: Fix for bug #1709848 by Ariden01 allows folding of all tags in XML and only terminates script mode with script end tag rather than any tag in XML. --- src/LexHTML.cxx | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/LexHTML.cxx') diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index fe9516357..a816ea188 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -223,7 +223,7 @@ 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 caseSensitive, bool isXml) { char s[30 + 2]; // Copy after the '<' unsigned int i = 0; @@ -239,9 +239,10 @@ static int classifyTagHTML(unsigned int start, unsigned int end, s[i] = ' '; s[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 - // (There are many more. We will need a keywordlist in the property file for this) - tagDontFold = (NULL != strstr("meta link img area br hr input ",s)); + tagDontFold = (!isXml) && (NULL != strstr("meta link img area br hr input ",s)); //now we can remove the trailing space s[i] = '\0'; @@ -458,7 +459,7 @@ static int FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringD } static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], - Accessor &styler) { + Accessor &styler, bool isXml) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; @@ -655,7 +656,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty break; default : // check if the closing tag is a script tag - if (state == SCE_HJ_COMMENTLINE) { + if (state == SCE_HJ_COMMENTLINE || isXml) { char tag[7]; // room for the