This project is read-only.

PHP + HTML mixed syntax highlighting

Topics: Developer Forum, Project Management Forum, User Forum
Jan 30, 2009 at 7:21 AM
Anyone managed to get subj work with custom xml files? Is it possible at all?
I made a test code just to play with and seems the order of sublanguage sections does matter, which is surprising by itself.
Anyway, I have tried a lot of combinations involving changing LexerName(phpscript,hypertext), order of sublanguages even without them, no good. I can see properly either PHP or HTML, not at the same time.

<?xml version="1.0" encoding="utf-8"?>
    <Language Name="myphp">

        <Lexer LexerName="phpscript" LineCommentPrefix="//" />
        <Styles Inherit="False">

            <SubLanguage Name="PHP">
                <Style Name="COMPLEX_VARIABLE" ForeColor="Red" />
                <Style Name="DEFAULT" ForeColor="Red" />
                <Style Name="HSTRING" ForeColor="DarkBlue" />
                <Style Name="SIMPLESTRING" ForeColor="Red" />
                <Style Name="WORD" ForeColor="Red" />
                <Style Name="NUMBER" ForeColor="Blue" />
                <Style Name="VARIABLE" ForeColor="DarkBlue" />
                <Style Name="COMMENT" ForeColor="#EEEEEE" />
                <Style Name="COMMENTLINE" ForeColor="#EEEEEE" />
                <Style Name="HSTRING_VARIABLE" ForeColor="DarkBlue" />
                <Style Name="OPERATOR" ForeColor="Red" />

            <SubLanguage Name="HTML">
                <Style Name="TAG" ForeColor="Green"/>
                <Style Name="DEFAULT" ForeColor="Green"/>