[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: clean html text?
- Subject: Re: clean html text?
- From: gareth@vcn.bc.ca (Gareth Jones)
- Date: 1996/12/27
- Newsgroups: comp.sys.apple2
- Organization: Vancouver CommunityNet
- References: <59ra1n$s6t@news.ysu.edu>
I recently wrote a short article about doing something decent with the
tags (e.g. <H1> </H1>) in HTML instead of just stripping them out. Someone
had sent me an article for my newsletter in HTML source code, and it
looked just great when I dragged it onto Netscape on a Mac, but even
Netscape just had two options for saving it: as source (which I already
had) or as plain text. If I saved as plain text, I'd lose the nice
formatting (centring, bolding, underlining, italicization). So what I did
was create a set of macros in WordPerfect IIGS that
1. capitalized all text between angle brackets (so that the next steps
would work)
2. Removed all the RETURN characters from the file. (HTML ignores them).
3. Turned all <P> tags into return characters.
4. A number of macros at this point would search out a particular ending
tag (e.g. </B> ends boldfaced text), turn BLOCK ON to select text, search
backward for the beginning tag (e.g. <B>) then select the style or
justification that you want for that particular tag. Boldface would
probably be best for this example. Centred, bolded and underlined might be
sufficiently emphatic for <H1> headlines. This is up to your HTML
reference and your conscience.
5. The final step is a macro to remove all tags (i.e. all text that is
between "<" and ">" characters).
This process leaves me with a pretty nice formatted document, ready for
importing into GraphicWriter III (with the beta WordPerfect translator
from 7 Hills). I am absolutely sure that the same results can be acheived
with either AppleWorks macros or an Apple Writer WPL program. I hope that
if anyone creates macros for these programs, they will share them.
-Gareth