Explanation above written by
netizensmith is absolutely right. But it is even more complicated for HTML (and XML).
In general such a syntax highlighting is possible in UltraEdit. And for most programming and scripting languages brackets and operators are defined in 1 or more color groups for being highlighted different to language keywords, custom symbols and other text.
The attached wordfile
hypertext.uew with a language named
HyperText demonstrates syntax highlighting as
Fiorellino would like to use for HTML files for files with extension
HT. This wordfile is based on
html.uew installed with UltraEdit for Windows v22.20.0.40.
But HTML and also XML are different and can't be highlighted using standard methods. Therefore UltraEdit contains special code for syntax highlighting HTML, XHTML and XML files.
Those built-in specials for HTML files make it impossible to append the file extensions
HTM and
HTML at end of first line of
HyperText.uew and then get a syntax highlighting like for *.ht files for *.htm or *.html files.
Even if the wordfile containing the file extension of active HTML file does not contain language marker
HTML_LANG or contains a different known language marker from list included on page
Syntax Highlighting in help of UltraEdit, UltraEdit applies automatically for *.htm and *.html files the special syntax highlighting activated also by language marker
HTML_LANG.
This is necessary to support HTML specific features like:
I think, I have to explain the second feature more clearly specific for HTML.
UltraEdit uses as simple mechanism for syntax highlighting. It takes the character stream of a file and splits it up into strings by using the characters defined in the wordfile on line starting with
/Delimiters =. For more details download from
the ultimate syntax highlighting tools the ZIP file and read HTML documentation for
TestForInvalid being included in this ZIP file.
Then each string is compared either case-sensitive or case-insensitive with the strings (words) specified in the syntax highlighting wordfile to determine the color.
So this simple method does not take the context into account, i.e. it does not check what is left and what is right to a string to highlight.
This context ignoring behavior is a big problem for HTML highlighting as there are many strings where context is important. For example there is the
element title with the tags
<title> (start tag with no attributes),
<title (start tag with attributes) and
</title> (end tag) as also the
attribute title which requires a value in single or double quotes and therefore is valid only with
title=. HTML specification lists several such context specific meanings like for
element span and
attribute span to list here just one more example.
So for HTML (and also XML) it is extremely important what is left and what is right of a string to highlight. Usually UltraEdit supports only that a string in the wordfile in a color group starts with a delimiter character to support differences on highlighting depending on character left to a "word". But for HTML/XML it is important to support also
< and
</ left to a word and
= and
> right to a word to be able to highlight tags of elements different to attributes. This is the reason why for wordfiles containing
HTML_LANG or
XML_LANG it is possible and for correct highlighting even required to define tags and attributes with
<,
</,
= and
> which must be nevertheless sorted in wordfile like when those characters would not be there.
As UltraEdit contains for some file types (= file extensions) internal defaults which can be overwritten by a customized wordfile like applying
HTML_LANG for *.htm and *.html files or
XML_LANG for *.xml files and others, it is not possible with UE v22.20 to get a syntax highlighting as wanted by
Fiorellino for HTML files.
Fiorellino, I can only suggest to send an email to IDM support with the feature request to be able to define a color for begin and end of an HTML/XML tag and the equal sign of an attribute for highlighting
<,
</,
=,
> and
/> (empty element) different to element / attribute name.
Such an enhancement could work with a
html.uew as packed by me also into the ZIP file. With using this version of the wordfile the different highlighting works currently by 100% for
= and
/>, just partly for
> (only on quote left to angle bracket) and not at all for
< and
</.