Highlight all tags starting with <@ with a different color in HTML files

Highlight all tags starting with <@ with a different color in HTML files

8
NewbieNewbie
8

    Sep 01, 2014#1

    I have configured a new HTML file for highlighting certain tags in my html files. Everything works just fine accept for this one line I need to highlight so I can see it easily. It uses the @ symbol. I removed the @ symbol from the delimiters line so it looks like this:

    Code: Select all

    /Delimiters = ! "	$%&'()*+,.:;<=>?[\]^{|}~
    I am trying to highlight special tags in my file so I can find sections. So for every section I have:
    <@2>
    <@3>
    <@4>
    and so on...

    Here's what I have so far:

    Code: Select all

    /C5"Sectioning"
    <@
    But it's not highlighting with the colors I have selected. Also how would I put in to highlight any number after @ and before > so it could also be included in the color highlight?

    6,602548
    Grand MasterGrand Master
    6,602548

      Sep 01, 2014#2

      The wordfile for HTML contains in first line the language marker HTML_LANG. This keyword changes interpretation of strings in the wordfile with angle brackets like language marker XML_LANG in wordfile(s) for XML. The different behavior is explained in help of UltraEdit on page Syntax Highlighting.

      To get the (invalid) tags <@1> <@2> <@3> ... highlighted with a color, it is necessary to
      1. remove @ from list of delimiter characters (already done), and
      2. specify all those tags exactly as used in HTML files also in the wordfile.
      So you need in the wordfile:

      Code: Select all

      /C5"Sectioning"
      <@1> <@2> <@3> <@4> <@5> <@6> <@7> <@8> <@9> <@10> <@11> <@12>
      A substring definition is not possible with tags in a wordfile with language marker HTML_LANG or XML_LANG. It has also no effect on specifying in the wordfile just the string between opening and closing angle bracket.

      The reason is quite simple: only tags should be highlighted which are valid to indicate an error if not valid.

      Look for example in html.uew on <a </a> and <b> <b </b>.

      It is allowed for HTML element B according to the HTML standards to specify the starting tag with or without attributes. Therefore the wordfile contains <b> and <b and a closing tag is also always needed.

      But for HTML element A it is not allowed to use the starting tag without any attribute. <a> is an invalid tag. This is the reason why there is also no <a> in the wordfile. <a> in the HTML file is displayed as normal text which indicates that this is not a valid tag.

      In XML files 4 variants for an element are in general possible.
      1. Element is always an empty element with attributes: just <tag is defined in the wordfile.
      2. Element requires a starting and closing tag, but attributes are not allowed: <tag> and </tag> are defined in the wordfile.
      3. Element can be used as an empty element, or an element with a value and therefore with a starting and closing tag, but the starting tag requires at least 1 attribute: <tag and </tag> are defined in the wordfile.
      4. Element can be used as an empty element, or an element with a value and therefore with a starting and closing tag whereby the starting tag can be without attributes, but can also have attributes: <tag>, <tag and </tag> are defined in the wordfile.
      However, it is possible to highlight all tags starting with <@ and ending with > nevertheless with a different color very easily.

      Just insert in first line of HTML after Block Comment On = <!-- Block Comment Off = --> the alternate block comment definition:

      Code: Select all

      Block Comment On Alt = <@ Block Comment Off Alt = >
      There is a separate color setting for alternate block comment.

      It is not even necessary to remove @ from the list of delimiter characters by using this method.

      Note: Only 1 *.uew file can have language marker HTML_LANG and is therefore used for HTML sections in multilanguage HTML files in the wordfiles directory. The wordfiles directory is usually %APPDATA%\IDMComp\UltraEdit\wordfiles if nothing different is configured. As XML files do not need multilanguage syntax highlighting, such a limitation does not exist for *.uew files containing language marker XML_LANG used to syntax highlight XML files of different type (= different sets of tags, attributes and values).
      Best regards from an UC/UE/UES for Windows user from Austria