Re: aliases in HTML

Paul Ramsey ([email protected])
Tue, 4 Oct 94 21:16:53 PDT


> Is there any way to custom-define a tag in an HTML document, say a
> tag <bug> which will be expanded to <img src="bug.gif"> when the
> document is viewed? Thanks in advance.

You could use the C proprocessor. It would just require that you build your
HTML pages from source.

---- test.cpp -------
#define bug img src="bug.gif"

<body>
<bug>
<p>This is a paragraph of text
<bug>
</body>

--- Makefile ---
test.html: test.cpp
/usr/ccs/lib/cpp -P test.cpp > test.html

-------- test.html --------

<body>
<img src="bug.gif">
<p>This is a paragraph of text
<img src="bug.gif">
</body>

Be careful since some C preprocessors want to do some reformatting of your
data these days but most of the old ones will leave everything but the
macros alone. Also the location and options to your CPP may be different.

paul r.