Syntax highlighting for STRINGS doesn't work for HTML (solved)

Syntax highlighting for STRINGS doesn't work for HTML (solved)

2
NewbieNewbie
2

    Dec 03, 2015#1

    Hi!

    I'm working with the latest UE build (22.20.0.40) and it seems that the syntax highlighting (colour and font-style) for STRINGS doesn't work. Strings have only the colour and font-style of normal text!

    Is there a way to fix it?

    Fiorellino

    481
    Basic UserBasic User
    481

      Dec 03, 2015#2

      Which programming language files are you using? e.g. C, Java

      I have some Java code open and the string literals in there are highlighted as I would expect.

      6,602548
      Grand MasterGrand Master
      6,602548

        Dec 03, 2015#3

        Fiorellino, you should always write for which language on posting a question in syntax highlighting forum. We don't see your screen and UltraEdit is not designed for a specific language.

        html.uew in directory displayed at Advanced - Configuration - Editor Display - Syntax Highlighting contains in first line the keyword Noquote which disables string highlighting. Of course this can be changed.

        For example the first line of the my html.uew is:

        Code: Select all

        /L3"HTML" HTML_LANG Nocase Block Comment On = <!-- Block Comment Off = --> String Chars = " EnableMLS File Extensions = HTM HTML SHTML HTT HTA HTX CFM JSP PHP PHTML ASP TMPL ASAX ASHX ASMX ASPX ASCX
        So I have enabled multi-line string highlighting for HTML, but just for double quoted strings, not for single quoted strings.

        Why not using String Chars = "' for string highlighting also single quoted strings?

        I'm using double quoted strings when referencing an URL, file or writing a visitor readable string (alternative text, title text, ...). Those strings should be highlighted as string.

        But on attributes with a definite value I use either no quotes (possible in HTML, not permitted in XHTML) or use single quotes.

        This makes it possible for me to highlight also defined attribute values.

        My html.uew contains therefore additional color groups not present in standard html.uew installed with UltraEdit.

        Code: Select all

        /C4"Color definition"
        ** #
        /C5"Values of attributes"
        _blank _blank> _parent _parent> _top _top>
        above above> all all>
        baseline baseline> behavior behavior> below below> border border> bottom bottom> box box>
        center center> circle circle> cols cols>
        disc disc>
        fixed fixed>
        groups groups>
        hsides hsides>
        justify justify>
        left left> lhs lhs>
        middle middle>
        none none>
        poly
        rect rhs rhs> right right> rows rows>
        square square>
        top top>
        vertical vertical> void void> vsides vsides>
        /C6"Dashes and NBSP"
        –
        —
         
        
        The last color group contains with Windows 1252 code page an en dash (code value 0x96), an em dash (code value 0x97) and a non breaking space (code value 0xA0). I have configured for color group Dashes and NBSP same foreground color as for normal text, but a different background color. This is a help for me to see those special characters often pasted from other files into an HTML file and which reminds me to run either a macro on selected text or entire file to replace those characters with their appropriate HTML entities or replacing them by standard dash (hyphen) or minus character (with entity) or normal space depending on context or removing the character at all.

        One more hint:

        By removing Noquote from first line of html.uew highlighting of single and double quoted strings becomes active even without specifying String Chars = "' as this is the internal default. By writing into the wordfile either

        Code: Select all

        /C7"Single Quoted Strings"
        '
        
        or

        Code: Select all

        /C7"Double Quoted Strings"
        "
        
        it is possible to define different colors for double and single quoted strings. With such a definition one type of strings is highlighted with the color group defined for Strings and the other type of strings with the color defined for the color group 7 for this example.
        Best regards from an UC/UE/UES for Windows user from Austria