Re: aliases in HTML

>   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.

Received on Wednesday, 5 October 1994 05:29:05 UTC