1# FTE mode for editing HTML files
2# maintained by m_debusk@sourceforge.com
3# Revision 2001-11-18
4
5# Runs current file in browser
6sub HTML_View {
7    RunProgram "netscape.exe -browser -l en_US file:///" . $FilePath;
8}
9
10# Runs Dave Ragget's HTML Tidy on current file
11sub HTML_Tidy {
12    RunProgram "f:\\os2_apps\\tidy\\tidy.exe -m " . $FilePath;
13}
14
15# Basic stuff
16sub HTML_BR   { InsertString "<br />"; }
17sub HTML_HR   { InsertString "<hr />"; }
18
19sub HTML_HTM {
20    ?MoveBlockStart; InsertString "<html>"; 2:LineNew;
21    ?MoveBlockEnd; SavePos; BlockUnmark; 2:LineNew;
22    InsertString "</html>"; MoveSavedPos;
23}
24
25sub HTML_HEAD {
26    ?MoveBlockStart; InsertString "<head>"; LineNew;
27    ?MoveBlockEnd; SavePos; BlockUnmark; LineNew;
28    InsertString "</head>"; MoveSavedPos;
29}
30sub HTML_TITLE {
31    ?MoveBlockStart; InsertString "<title>";
32    ?MoveBlockEnd; InsertString "</title>"; 8:MoveLeft; BlockUnmark;
33}
34
35sub HTML_BODY {
36    ?MoveBlockStart; InsertString "<body>"; 2:LineNew;
37    ?MoveBlockEnd; SavePos; 2:LineNew; InsertString "</body>";
38    BlockUnmark; MoveSavedPos;
39}
40
41sub HTML_META {
42    MoveFileStart; ?Find /<head>/ "i"; MoveLineEnd; LineNew;
43    InsertString "<meta name=\"\" content=\"\" />"; 15:MoveLeft
44}
45
46sub HTML_BASEURL {
47    MoveFileStart; ?Find /<head>/ "i"; MoveLineEnd; LineNew
48    InsertString "<base href=\"\" />"; 4:MoveLeft
49}
50
51sub HTML_P {
52    ?MoveBlockStart; InsertString "<p>";
53    ?MoveBlockEnd; InsertString "</p>"; 4:MoveLeft; BlockUnmark;
54}
55
56sub HTML_CENTER {
57    # shouldn't really do this, but it's convenient.
58    ?MoveBlockStart; InsertString "<span style=\"text-align: center\">";
59    ?MoveBlockEnd; InsertString "</span>"; 7:MoveLeft;
60}
61
62# Comment
63sub HTML_COMMENT {
64    ?MoveBlockStart; InsertString "<!-- ";
65    ?MoveBlockEnd; InsertString " -->"; 4:MoveLeft; BlockUnmark;
66}
67
68# DTDs
69sub HTML_DTD_X1S { # XHTML 1.0 Strict
70    MoveFileStart; LineInsert;
71    InsertString "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
72    MoveFileStart;
73}
74
75sub HTML_DTD_X1T { # XHTML 1.0 Transitional
76    MoveFileStart; LineInsert;
77    InsertString "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
78    MoveFileStart;
79}
80
81sub HTML_DTD_X1F { # XHTML 1.0 Frameset
82    MoveFileStart; LineInsert;
83    InsertString "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">";
84    MoveFileStart;
85}
86
87sub HTML_DTD_4S { # HTML 4.01 Strict
88    MoveFileStart; LineInsert;
89    InsertString "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">";
90    MoveFileStart;
91}
92
93sub HTML_DTD_4T { # HTML 4.01 Transitional
94    MoveFileStart; LineInsert;
95    InsertString "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
96    MoveFileStart;
97}
98
99sub HTML_DTD_4F { # HTML 4.01 Frameset
100    MoveFileStart; LineInsert;
101    InsertString "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">";
102    MoveFileStart;
103}
104
105sub HTML_DTD_32F { # HTML 3.2 Final
106    MoveFileStart; LineInsert;
107    InsertString "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">";
108    MoveFileStart;
109}
110
111sub HTML_DTD_2 { # HTML 2.0; Why not?
112    MoveFileStart; LineInsert;
113    InsertString "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">";
114    MoveFileStart;
115}
116
117# headers
118sub HTML_H1 {
119    ?MoveBlockStart; InsertString "<h1>";
120    ?MoveBlockEnd; InsertString "</h1>"; 5:MoveLeft; BlockUnmark;
121}
122
123sub HTML_H2 {
124    ?MoveBlockStart; InsertString "<h2>";
125    ?MoveBlockEnd; InsertString "</h2>"; 5:MoveLeft; BlockUnmark;
126}
127
128sub HTML_H3 {
129    ?MoveBlockStart; InsertString "<h3>";
130    ?MoveBlockEnd; InsertString "</h3>"; 5:MoveLeft; BlockUnmark;
131}
132
133sub HTML_H4 {
134    ?MoveBlockStart; InsertString "<h4>";
135    ?MoveBlockEnd; InsertString "</h4>"; 5:MoveLeft; BlockUnmark;
136}
137
138sub HTML_H5 {
139    ?MoveBlockStart; InsertString "<h5>";
140    ?MoveBlockEnd; InsertString "</h5>"; 5:MoveLeft; BlockUnmark;
141}
142
143sub HTML_H6 {
144    ?MoveBlockStart; InsertString "<h6>";
145    ?MoveBlockEnd; InsertString "</h6>"; 5:MoveLeft; BlockUnmark;
146}
147
148# Character Format
149sub HTML_B {
150    ?MoveBlockStart; InsertString "<b>";
151    ?MoveBlockEnd; InsertString "</b>"; 4:MoveLeft; BlockUnmark;
152}
153
154sub HTML_STRONG {
155    ?MoveBlockStart; InsertString "<strong>";
156    ?MoveBlockEnd; InsertString "</strong>"; 9:MoveLeft; BlockUnmark;
157}
158
159sub HTML_I {
160    ?MoveBlockStart; InsertString "<i>";
161    ?MoveBlockEnd; InsertString "</i>"; 4:MoveLeft; BlockUnmark;
162}
163
164sub HTML_EM {
165    ?MoveBlockStart; InsertString "<em>";
166    ?MoveBlockEnd; InsertString "</em>"; 5:MoveLeft; BlockUnmark;
167}
168
169sub HTML_BIG {
170    ?MoveBlockStart; InsertString "<big>";
171    ?MoveBlockEnd; InsertString "</big>"; 6:MoveLeft; BlockUnmark;
172}
173
174sub HTML_SMALL {
175    ?MoveBlockStart; InsertString "<small>";
176    ?MoveBlockEnd; InsertString "</small>"; 8:MoveLeft; BlockUnmark;
177}
178
179sub HTML_SUP {
180    ?MoveBlockStart; InsertString "<sup>";
181    ?MoveBlockEnd; InsertString "</sup>"; 6:MoveLeft; BlockUnmark;
182}
183
184sub HTML_SUB {
185    ?MoveBlockStart; InsertString "<sub>";
186    ?MoveBlockEnd; InsertString "</sub>"; 6:MoveLeft; BlockUnmark;
187}
188
189sub HTML_BDO {
190    ?MoveBlockStart; InsertString "<bdo dir=\"ltr|rtl\">"; 6:MoveLeft;
191    SavePos; 6:MoveRight; ?MoveBlockEnd; InsertString "</bdo>";
192    BlockUnmark; MoveSavedPos;
193}
194
195# Output Format
196sub HTML_PRE {
197    ?MoveBlockStart; InsertString "<pre>"; LineNew;
198    ?MoveBlockEnd; SavePos; BlockUnmark; LineNew;
199    InsertString "</pre>"; MoveSavedPos;
200}
201
202sub HTML_CODE {
203    ?MoveBlockStart; InsertString "<code>"; #LineNew;
204    ?MoveBlockEnd; #SavePos;
205    BlockUnmark; #LineNew;
206    InsertString "</code>"; 7:MoveLeft; #MoveSavedPos;
207}
208
209sub HTML_TT {
210    ?MoveBlockStart; InsertString "<tt>"; #LineNew;
211    ?MoveBlockEnd; #SavePos;
212    BlockUnmark; #LineNew;
213    InsertString "</tt>"; 5:MoveLeft; #MoveSavedPos;
214}
215
216sub HTML_KBD {
217    ?MoveBlockStart; InsertString "<kbd>"; #LineNew;
218    ?MoveBlockEnd; SavePos; BlockUnmark; #LineNew;
219    InsertString "</kbd>"; MoveSavedPos;
220}
221
222sub HTML_VAR {
223    ?MoveBlockStart; InsertString "<var>"; LineNew;
224    ?MoveBlockEnd; SavePos; BlockUnmark; LineNew;
225    InsertString "</var>"; MoveSavedPos;
226}
227
228sub HTML_SAMP {
229    ?MoveBlockStart; InsertString "<samp>"; LineNew;
230    ?MoveBlockEnd; SavePos; BlockUnmark; LineNew;
231    InsertString "</samp>"; MoveSavedPos;
232}
233
234# Blocks
235sub HTML_ACRONYM {
236    ?MoveBlockStart; InsertString "<acronym title=\"\">"; 2:MoveLeft;
237    SavePos; 2:MoveRight; ?MoveBlockEnd; InsertString "</acronym>";
238    BlockUnmark; MoveSavedPos;
239}
240
241sub HTML_ABBR {
242    ?MoveBlockStart; InsertString "<abbr title=\"\">"; 2:MoveLeft;
243    SavePos; 2:MoveRight; ?MoveBlockEnd; InsertString "</abbr>";
244    BlockUnmark; MoveSavedPos;
245}
246
247sub HTML_ADDRESS {
248    ?MoveBlockStart; InsertString "<address>"; LineNew;
249    ?MoveBlockEnd; SavePos; BlockUnmark; LineNew;
250    InsertString "</address>"; MoveSavedPos;
251}
252
253sub HTML_BLOCKQUOTE {
254    ?MoveBlockStart; InsertString "<blockquote>"; LineNew;
255    ?MoveBlockEnd; SavePos; BlockUnmark; LineNew;
256    InsertString "</blockquote>"; MoveSavedPos;
257}
258
259sub HTML_Q {
260    ?MoveBlockStart; InsertString "<q>";
261    ?MoveBlockEnd; InsertString "</q>"; 4:MoveLeft; BlockUnmark;
262}
263
264sub HTML_CITE {
265    ?MoveBlockStart; InsertString "<cite>";
266    ?MoveBlockEnd; InsertString "</cite>"; 7:MoveLeft; BlockUnmark;
267}
268
269sub HTML_INS {
270    ?MoveBlockStart; InsertString "<ins>";
271    ?MoveBlockEnd; InsertString "</ins>"; 6:MoveLeft; BlockUnmark;
272}
273
274sub HTML_DEL {
275    ?MoveBlockStart; InsertString "<del>";
276    ?MoveBlockEnd; InsertString "</del>"; 6:MoveLeft; BlockUnmark;
277}
278
279# forms
280sub HTML_INPUT {
281    InsertString "<input type=\"\" />"; 4:MoveLeft;
282}
283
284sub HTML_FORM {
285    InsertString "<form>"; LineNew; HTML_INPUT; SavePos; 4:MoveRight;
286    LineNew; InsertString "</form>"; MoveSavedPos;
287}
288
289sub HTML_TEXTAREA {
290    ?MoveBlockStart; InsertString "<textarea rows=\"\" cols=\"\">"; 10:MoveLeft;
291    SavePos; 10:MoveRight; ?MoveBlockEnd; InsertString "</textarea>";
292    MoveSavedPos;
293}
294
295sub HTML_BUTTON {
296    InsertString "<button></button>"; 9:MoveLeft;
297}
298
299sub HTML_OPTION {
300    InsertString "<option value=\"\" />"; 4:MoveLeft;
301}
302
303sub HTML_SELECT {
304    InsertString "<select>"; LineNew; HTML_OPTION; SavePos; 4:MoveRight;
305    LineNew; HTML_OPTION; 4:MoveRight; LineNew; InsertString "</select>";
306    MoveSavedPos;
307}
308
309sub HTML_OPTGROUP {
310    InsertString "<optgroup label=\"\">"; LineNew; HTML_OPTION;
311    SavePos; 4:MoveRight; LineNew; HTML_OPTION; 4:MoveRight; LineNew;
312    InsertString "</optgroup>"; MoveSavedPos;
313}
314
315sub HTML_LABEL {
316    ?MoveBlockStart; InsertString "<label for=\"\">"; 2:MoveLeft; SavePos;
317    2:MoveRight; ?MoveBlockEnd; InsertString "</label>"; MoveSavedPos;
318}
319
320sub HTML_FIELDSET {
321    InsertString "<fieldset>"; LineNew; HTML_INPUT; SavePos; 4:MoveRight;
322    LineNew; InsertString "</fieldset>"; MoveSavedPos;
323}
324
325sub HTML_LEGEND {
326    ?MoveBlockStart; InsertString "<legend>"; ?MoveBlockEnd;
327    InsertString "</legend>"; 9:MoveLeft; BlockUnmark;
328}
329
330# lists
331sub HTML_DFN {
332    ?MoveBlockStart; InsertString "<dfn>";
333    ?MoveBlockEnd; InsertString "</dfn>"; 6:MoveLeft; BlockUnmark;
334}
335
336sub HTML_LI {
337    ?MoveBlockStart; InsertString "<li>";
338    ?MoveBlockEnd; InsertString "</li>"; 5:MoveLeft; BlockUnmark;
339}
340
341sub HTML_DT {
342    ?MoveBlockStart; InsertString "<dt>";
343    ?MoveBlockEnd; InsertString "</dt>"; 5:MoveLeft; BlockUnmark;
344}
345
346sub HTML_DD {
347    ?MoveBlockStart; InsertString "<dd>";
348    ?MoveBlockEnd; InsertString "</dd>"; 5:MoveLeft; BlockUnmark;
349}
350
351sub HTML_UL {
352    ?MoveBlockStart; InsertString "<ul>";
353    ?MoveBlockEnd; InsertString "</ul>"; 5:MoveLeft; BlockUnmark;
354}
355
356sub HTML_OL {
357    ?MoveBlockStart; InsertString "<ol>";
358    ?MoveBlockEnd; InsertString "</ol>"; 5:MoveLeft; BlockUnmark;
359}
360
361sub HTML_DL {
362    ?MoveBlockStart; InsertString "<dl>";
363    ?MoveBlockEnd; InsertString "</dl>"; 5:MoveLeft; BlockUnmark;
364}
365
366# Images
367sub HTML_IMG {
368    InsertString "<img src=\"\" height=\"\" width=\"\" alt=\"\" />"; 30:MoveLeft;
369}
370
371sub HTML_MAP {
372    InsertString "<img src=\"\" width=\"\" height=\"\" alt=\"\" usemap=\"#\" />";
373    41:MoveLeft; SavePos; MoveLineEnd; LineNew; InsertString "<map id=\"\">";
374    LineNew;
375    InsertString "<area shape=\"\" coords=\",,,\" href=\"\" alt=\"\" target=\"\" />";
376    LineNew; InsertString "</map>"; MoveSavedPos;
377}
378
379sub HTML_AREA {
380    InsertString "<area shape =\"\" coords=\",,,\" href=\"\" alt=\"\" target=\"\" />";
381    MoveLineStart;
382}
383
384# anchors
385sub HTML_ANAME {
386    ?MoveBlockStart; InsertString "<a name=\"\">"; 2:MoveLeft;
387    SavePos; 2:MoveRight; ?MoveBlockEnd; InsertString "</a>";
388    BlockUnmark; MoveSavedPos;
389}
390
391sub HTML_AHREF {
392    ?MoveBlockStart; InsertString "<a href=\"\">"; 2:MoveLeft;
393    SavePos; 2:MoveRight; ?MoveBlockEnd; InsertString "</a>";
394    BlockUnmark; MoveSavedPos;
395}
396
397sub HTML_LINK {
398    InsertString "<link rel=\"\" type=\"\" href=\"\" />"; 20:MoveLeft
399}
400
401# tables
402sub HTML_TABLE {
403    ?MoveBlockStart; InsertString "<table summary=\"\">"; 2:MoveLeft;
404    SavePos; 2:MoveRight; LineNew; ?MoveBlockEnd; LineNew;
405    InsertString "</table>"; BlockUnmark; MoveSavedPos;
406}
407
408sub HTML_CAPTION {
409    ?MoveBlockStart; InsertString "<caption>";
410    ?MoveBlockEnd; InsertString "</caption>"; 10:MoveLeft; BlockUnmark;
411}
412
413sub HTML_TH {
414    ?MoveBlockStart; InsertString "<th>";
415    ?MoveBlockEnd; InsertString "</th>"; 5:MoveLeft; BlockUnmark;
416}
417
418sub HTML_TR {
419    ?MoveBlockStart; InsertString "<tr>";
420    ?MoveBlockEnd; InsertString "</tr>"; 5:MoveLeft; BlockUnmark;
421}
422
423sub HTML_TD {
424    ?MoveBlockStart; InsertString "<td>";
425    ?MoveBlockEnd; InsertString "</td>"; 5:MoveLeft; BlockUnmark;
426}
427
428sub HTML_COL {
429    ?MoveBlockStart; InsertString "<col span=\"\" width=\"\">"; 11:MoveLeft;
430    SavePos; 11:MoveRight; ?MoveBlockEnd; InsertString "</col>"; BlockUnmark;
431    MoveSavedPos;
432}
433
434sub HTML_COLGROUP {
435    ?MoveBlockStart; InsertString "<colgroup span=\"\" width=\"\">"; 11:MoveLeft;
436    SavePos; 11:MoveRight; ?MoveBlockEnd; InsertString "</colgroup>"; BlockUnmark;
437    MoveSavedPos;
438}
439
440sub HTML_THEAD {
441    ?MoveBlockStart; InsertString "<thead>";
442    ?MoveBlockEnd; InsertString "</thead>"; 8:MoveLeft; BlockUnmark;
443}
444
445sub HTML_TFOOT {
446    ?MoveBlockStart; InsertString "<tfoot>";
447    ?MoveBlockEnd; InsertString "</tfoot>"; 8:MoveLeft; BlockUnmark;
448}
449
450sub HTML_TBODY {
451    ?MoveBlockStart; InsertString "<tbody>";
452    ?MoveBlockEnd; InsertString "</tbody>"; 8:MoveLeft; BlockUnmark;
453}
454
455# Frames
456sub HTML_FRAME {
457    ?MoveBlockStart; InsertString "<frame>"; 2:LineNew;
458    ?MoveBlockEnd; SavePos; BlockUnmark; 2:LineNew;
459    InsertString "</frame>"; MoveSavedPos;
460}
461
462sub HTML_NOFRAMES {
463    ?MoveBlockStart; InsertString "<noframes>";
464    ?MoveBlockEnd; InsertString "</noframes>"; 11:MoveLeft; BlockUnmark;
465}
466
467sub HTML_FRAMESET {
468    ?MoveBlockStart; InsertString "<frameset>"; 2:LineNew;
469    InsertString "<noframes></noframes>"; 11:MoveLeft;
470    SavePos; 11:MoveRight; 2:LineNew; ?MoveBlockEnd;
471    InsertString "</frameset>"; BlockUnmark; MoveSavedPos;
472}
473
474sub HTML_IFRAME {
475    ?MoveBlockStart;
476    InsertString "<iframe src=\"\" height=\"\" width=\"\" scrolling=\"yes|no|auto\">";
477    45:MoveLeft; SavePos; 45:MoveRight; ?MoveBlockEnd; InsertString "</iframe>";
478    BlockUnmark; MoveSavedPos;
479}
480
481# Styles
482sub HTML_STYLE {
483    InsertString "<style type=\"text/css|javascript\">"; 13:MoveLeft;
484    SavePos; 13:MoveRight; LineNew; InsertString "<!--"; 2:LineNew;
485    InsertString "-->"; LineNew; InsertString "</style>"; MoveSavedPos;
486}
487
488sub HTML_DIV {
489    ?MoveBlockStart; InsertString "<div>"; MoveLeft; SavePos; MoveRight; LineNew;
490    ?MoveBlockEnd; BlockUnmark; LineNew;
491    InsertString "</div>"; MoveSavedPos; MoveRight;
492}
493
494sub HTML_SPAN {
495    ?MoveBlockStart; InsertString "<span>"; MoveLeft;
496    SavePos; MoveRight; ?MoveBlockEnd; BlockUnmark;
497    InsertString "</span>"; 8:MoveLeft; MoveSavedPos; MoveRight;
498}
499
500# Programming
501sub HTML_SCRIPT {
502    InsertString "<script type=\"text/\"></script>"; 11:MoveLeft;
503    SavePos;  11:MoveRight; LineNew; InsertString "<!--"; 2:LineNew;
504    InsertString "-->"; LineNew; InsertString "<noscript></noscript>";
505    MoveSavedPos;
506}
507
508sub HTML_NOSCRIPT {
509    ?MoveBlockStart; InsertString "<noscript>"; MoveBlockEnd;
510    InsertString "</noscript>"; 11:MoveLeft; BlockUnmark;
511}
512
513sub HTML_OBJECT {
514    InsertString "<object></object>"; 9:MoveLeft;
515}
516
517sub HTML_PARAM {
518    InsertString "<param name=\"\" value=\"\" valuetype=\"\" type \"\"></param>"; 8:MoveLeft;
519}
520
521# basic document skeleton
522sub HTML_Base {
523    MoveFileStart;
524    InsertString "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
525    2:LineNew;
526    InsertString "<html>"; 2:LineNew;
527    InsertString "<head>"; LineNew;
528    InsertString "<!-- copyright (c)  -->"; 4:MoveLeft;
529    InsertDate "%Y"; InsertString " by "; InsertUid; MoveLineEnd; LineNew;
530    InsertString "<meta name=\"generator\" content=\"FTE ";
531    InsertString $FTEVer;
532    InsertString "\" />";
533    LineNew;
534    InsertString "<meta name=\"revised\" content=\"\" />"; 4:MoveLeft;
535    InsertUid; InsertString ","; InsertDate "%Y-%m-%d"; MoveLineEnd;
536    LineNew;
537    InsertString "<meta name=\"keywords\" content=\"\" />"; LineNew;
538    InsertString "<meta name=\"description\" content=\"\" />";
539    LineNew;
540    InsertString "<meta name=\"author\" content=\"\" />"; 4:MoveLeft;
541    InsertUid; 4:MoveRight; LineNew;
542    InsertString "<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\" />";
543    LineNew;
544    InsertString "<title>"; InsertString $FileBaseName;
545    InsertString "</title>"; LineNew;
546    InsertString "</head>"; 2:LineNew;
547    InsertString "<body>"; 2:LineNew; MoveFileEnd; LineAdd;
548    MoveLineStart; InsertString "</body>"; 2:LineNew;
549    InsertString "</html>"; MoveFileStart; 8:MoveDown;
550    MoveLineEnd; 4:MoveLeft;
551}
552
553# Converts plain text to HTML
554sub HTML_TXT {
555    MoveFileStart;
556    ?FindReplace /&/ /&amp;/ "agn" ;
557    ?FindReplace /</ /&lt;/ "agn" ;
558    ?FindReplace />/ /&gt;/ "agn" ;
559    ?FindReplace /</ /&lt;/ "agn" ;
560    ?FindReplace /"/ /&quot;/ "agn" ;
561    ?FindReplace /(c)/ /&copy;/ "agn" ;
562    ?FindReplace /|/ /&brvbar;/ "agn";
563    ?FindReplace /�/ /&not;/ "agn";
564    ?FindReplace /(tm)/ /<sup><small>tm<//small><//sup>/ "agn";
565    MoveFileStart;
566    LineInsert;
567    InsertString "<pre>"; MoveFileEnd;
568    LineNew; InsertString "</pre>";
569    HTML_Base;
570}
571
572# basic frame skeleton
573sub HTML_BaseFrame {
574    HTML_Base; SavePos; MoveFileStart; KillLine; HTML_DTD_X1F;
575    ?FindReplace /body>/ /frameset>/ "agn"; MoveSavedPos;
576}
577
578colorize HTML {
579    SyntaxParser = 'SIMPLE';
580
581    color {
582        { 'Normal',     'Editor_Default' },
583        { 'String',     'Lang_String' },
584        { 'Comment',    'Lang_Comment' },
585        { 'Command',    'Markup_Punctuation' },
586        { 'Symbol',     'Markup_Symbol' },
587        { 'Tag',        'Markup_Tag' },
588        { 'Special',    'Markup_Special' },
589    };
590
591    keyword "Editor_Keywords" { # XHTML 1.0 keywords
592        "a", "abbr", "acronym", "address", "area", "b", "base", "bdo",
593        "big", "blockquote", "body", "br", "button", "caption", "cite",
594        "code", "col", "colgroup", "dd", "del", "dfn", "div", "dl",
595        "dt", "em", "fieldset", "form", "frame", "frameset", "h1", "h2",
596        "h3", "h4", "h5", "h6", "head", "hr", "html", "i", "iframe",
597        "img", "input", "ins", "kbd", "label", "legend", "li", "link", "map",
598        "meta", "noframes", "noscript", "object", "ol", "optgroup",
599        "option", "p", "param", "pre", "q", "samp", "script", "select",
600        "small", "span", "strong", "style", "sub", "sup", "table",
601        "tbody", "td", "textarea", "tfoot", "th", "thead", "title", "tr",
602        "tt", "ul", "var"
603    };
604
605    keyword "Editor_Keywords2" { # Secondary keywords
606	"abbr", "above", "absbottom", "accept", "accept-charset", "accesskey",
607	"action", "align", "all", "alt", "archive", "auto", "axis",
608	"baseline", "below", "border", "bordercolor", "bottom", "box",
609	"button", "cellpadding", "cellspacing",  "char", "charoff", "charset",
610	"checkbox", "checked", 	"circle", "cite", "class", "classid", "clear",
611	"codebase", "codetype", "color", "cols", "colspan", "compact",
612	"content", "coords", "data", "datetime", "declare", "default",
613	"defer", "dir", "disabled", "disc", "enctype", "face", "file", "for",
614	"frame", "frameborder", "get", "groups", "headers", "height", "hidden",
615	"href", "hreflang","hsides", "hspace", "http-equiv", "id", "image",
616	"ismap", "justify", "label", "lang", "left", "lhs", "longdesc",
617	"ltr", "mailto", "marginheight", "marginwidth", "maxlength", "media",
618	"method", "middle", "multiple", "name", "no", "nohref", "none",
619	"noresize", "noshade", "nowrap", "param", "password", "poly", "post",
620	"profile", "prompt", "radio", "readonly", "rect", "rel", "reset",
621	"rev", "rhs", "right", "rows", "rowspan", "rtl", "rules", "scheme",
622	"scope", "scrolling", "selected", "shape", "size", "span", "square",
623	"src", "standby", "start", "style", "subject", "submit", "summary",
624	"tabindex", "target", "title", "top", "type", "usemap", "valign",
625	"value", "valuetype", "void", "vsides", "vspace", "width", "wrap",
626	"yes", "_blank", "_parent", "_self", "_top",
627	# DTD
628	"doctype", "public",
629    };
630    keyword "Editor_Keywords3" { # Event attributes
631	"onfocus", "onblur", "onchange", "onclick", "ondblclick", "onfocus",
632	"onload", "onkeydown", "onkeypress", "onkeyup", "onmousedown",
633	"onmousemove", "onmouseout", "onmouseover", "onmouseup", "onreset",
634        "onselect", "onsubmit",
635    };
636
637
638    keyword "Editor_Keywords5" { # Deprecated in XHTML 1.0
639	"applet", "basefont", "center", "dir", "font", "isindex", "listing",
640	"menu", "plaintext", "s", "strike", "u", "xmp",
641	# depricated attributes
642        "alink", "background", "bgcolor", "language", "link", "text", "vlink",
643    };
644
645    h_state 0 { 'Normal' }
646    h_trans { 5, '<', '<!--', 'Comment' }
647    h_trans { 1, '<', '<', 'Command' }
648    h_trans { 2, '<', '&', 'Symbol' }
649
650    h_state 1 { 'Command' }
651    h_trans { 0, '>', '>', 'Command' }
652    h_trans { 3, '<', '\'', 'String' }
653    h_trans { 4, '<', '"', 'String' }
654    h_wtype { -1, -1, -1, 'i', 'a-zA-Z0-9_\-' }
655
656    h_state 2 { 'Symbol' }
657    h_trans { 0, '>', ';', 'Symbol' }
658    h_trans { 0, '-S', '#a-zA-Z0-9', 'Symbol' }
659
660    h_state 3 { 'String' }
661    h_trans { 1, '>', '\'', 'String' }
662
663    h_state 4 { 'String' }
664    h_trans { 1, '>', '"', 'String' }
665
666    h_state 5 { 'Comment' }
667    h_trans { 6, '>', '--', 'Comment' }
668
669    h_state 6 { 'Special' }
670    h_trans { 5, '>', '--', 'Comment' }
671    h_trans { 0, '>', '>', 'Comment' }
672}
673
674mode HTML: PLAIN {
675    FileNameRx          = /\.\c{S?HTML?}$/;
676    HilitOn             = 1;
677    Colorizer           = "HTML";
678    MultiLineHilit      = 1;
679    AutoHilitParen      = 1;
680
681    RoutineRegexp       = /\<[Hh]\d\>/;
682
683    SaveFolds           = 2;      # save fold info at end of line
684    CommentStart        = " <!--";
685    CommentEnd          = "-->";
686}
687