| ***********************************************
| *  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 by 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 syntactic 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 occurrences 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.
 
Only Acorn Extended Latin-1 is supported.

HTMLSTRIPCOMMENTS
Strips out all occurrences 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 (where possible) with their single-character equivalents.
 
Only Acorn Extended Latin-1 is supported; entities which do not have
corresponding characters in this set are left untouched.

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.

HTMLHEADING <string>
The <string> parameter is EVALuated to x.
If x >= 1 amd x <= 6 then this command inserts "<Hx></Hx>" around the current
selection, or at the cursor position if there is none.

HTMLLINK <href_string>
This is used for inserting links to other files into HTML documents.
If there is no selection present, the current cursor position is used.
 
The string and selection must not contain literal "s; use &quot; instead.

HTMLIMAGE <src_string>
This is used for inserting image files into HTML documents.
If there is no selection present, the current cursor position is used.
 
The string and selection must not contain literal "s; use &quot; instead.

HTMLREMARK
Inserts "<!--" and "-->" at the beginning and end of the current selection.
If there is no selection present, the current cursor position is used.

HTMLSINGLETAG <string>
Inserts the specified tag at the current cursor position.

HTMLTAGPAIR <string>
Inserts the specified tag around the current selection.
If there is no selection present, the current cursor position is used.
