[QScintilla] XML lexer and folding

Stefan Langer s.langer at artificial-technology.de
Wed May 7 09:51:07 BST 2008


Stefan Langer wrote:
>
>>> so ... what is wrong:
>>> - the QSci Lexer marks unknown Tags/Attributes red (but there is no
>>> unknown tags in xml ... it is_* *_*_EXTENSIBLE_ Markup Language* )
>>
>> This problem can be solved by making the styles for *unknown*
>> Tags/Attributes the same as those used for *known* Tags/Attributes.
> ok, i haven't mentioned that I experimented a bit more ... when i 
> changed the coloring of unknown tags/attributes to that of normal 
> tags/attributes, the tags are colored correctly ... but the attributes 
> aren't in "attribute color", if the tag is a unknown one (so in the 
> unknown-tags there seems to be no attribute-detection or something 
> like that)
>> It would be nice if there was a qscintilla lexer to encapsulate a sane
>> set of defaults for XML. If you feel like making a contribution, it
>> would be pretty easy to write one (just take a look at qscilexerhtml.cpp
>> for inspiration).
> i started playing around with a qscilexerxml.cpp ... if I find a 
> solution for that unknown-attributes within unknown-tags, i will 
> cleanup this experimental file and post it ...
ah, I have to clear my keyword-list ^^
LexHTML.cpp (scintilla):
...
    if ((chAttr == SCE_H_TAGUNKNOWN) && !keywords) {
        // No keywords -> all are known
        chAttr = SCE_H_TAG;
        isScript = 0 == strcmp(s, "script");
    }
...


after that the attributes seems ok ...


More information about the QScintilla mailing list