| ***********************************************
| *  ZapHoTMeaL commands   Tim Tyler 1995-1997 *
| ***********************************************

mode_hotmeal
Tim Tyler's HTML colouring mode.
For more details there is a help file available.

HTMLADDALTTEXT
This copies any "ALT" text in IMG tags to the text just after the end of the
tag.  This can be useful in conjunction with the HTMLSTRIPTAGS command.

HTMLENTITY
This acts like HTMLRAWENTITY.  It replaces entity characters with their
recommended equivalents.  Unlike HTMLRAWENTITY, it uses a variety of methods
to make sure that the contents of HTML tags remain unaffected.  Existing
entities also will not have their '&' characters modified.

SGML comments are recognised and skipped.  One limitation is that the
selected region should not start within a comment.  Starting the selection
within tags does not cause any problems, though.

A crude heuristic is used to determine what is an entity, and 'fish&chips;'
- which should be modified my HTMLENTITY to become 'fish&amp;chips;' is
currently left unmodified as the command assumes that '&chips;' is a valid
entity.

Any '<' characters in the document will be left unchanged, along with any
subsequent characters until the next '>'.  This should not prove too much
of a problem.

HTMLFLAGSTOGGLE <word>
This has the same syntax as the WFORMAT_TOGGLE command.  It ticks menu
entries if it is attached to them.

HTMLINSERTIF <string>
"HTMLINSERTIF <break><string1><break><string2><break><string3>"

The strings are delimited by a user-definable character represented as
<break> in the syntactical description.

string1 is inserted if the cursor is inside an HTML tag.
string2 is inserted if the cursor is outside all HTML tags.
string3 is inserted if the window is not in the HoTMeaL mode.

This is intended mainly for use with the quote character in keymaps.
Using something like...

Quote		&022	HTMLINSERTIF """&quot;"""

...in the keys file may be useful to some.

Note that this command has now been effectively replaced by TMT_IF with
the "INHTMLTAG" parameter.

HTMLRAWENTITY
Replaces all occurences of characters whose inclusion in HTML documents is
not recommended with their entity equivalents. It operates on any text in
the currently selected region. It will only operate if the file it has been
issued from contains the current selection.  It may be used in any mode.

All characters in the selected area are converted to entities.  This command
is not intended to be used on HTML documents, but is intended manly for
cases when raw text files are to be converted, or HTML source code is to be
included in HTML documents.

HTMLSTRIPCOMMENTS
Strips out all occurences of HTML comments in the currently selected region.
It has a primitive idea of what is a comment - it takes comments to be
anything which starts with "<!--" and finishes with "-->".

It will only operate if the file it has been issued from contains the current
selection.

HTMLSTRIPENTITIES
Strips out all the HTML entities in the currently selected region, replacing
them with their single-character equivalents.  "&ensp" and "&emsp" are
replaced with simple spaces.

This command currently operates quite slowly.  It may be aborted at any stage
by pressing the ESCAPE key.

It will only operate if the file it has been issued from contains the current
selection.

HTMLSTRIPSCRIPT
This strips out the title of the document and any applets, cascading
style-sheets, Javascript or other scripting languages found in therein.

It will only operate if the file it has been issued from contains the current
selection.

HTMLSTRIPTAGS
Strips out all the tags in the currently selected region.  It has a
primitive idea of what a tag is; i.e. it searches for "<" and then for ">"
and deletes these and any text in between.

