#! /usr/bin/perl

while (<>) {
	s/<[^>]+>//g;                                                              # contents of html tags
	s/&(.)(grave|acute|circ|tilde|uml|cedil|ring|caron|slash|dot|macr|breve);/$1/g; # diacritics
	s/&(..)lig;/$1/g;                                                          # ligatures
	s/&(Alpha|Beta|Gamma|Chi|Lambda|Sigma|Omega,Pi);/$1/g;                              # Greek
	s/&(alpha|beta|gamma|chi|lambda|sigma|omega,pi);/$1/g;                              # Greek
	s/&THORN;/Th/g;
	s/&amp;/&/g;
	s/&lt;/</g;
	s/&gt;/>/g;
	s/&infin;/INFINITY/g;
	s/&prime;/'/g;
	s/&percnt;/%/g;
	s/&frac12;/1\/2/g;
	s/&times;/x/g;
	s/&asymp;/~/g;
	s/&trade;//g;
	s/&pound;//g;
	s/&reg;//g;
	s/&euro;//g;
	s/&rarr;/->/g;
	s/&#039;/'/g;
	s/&#160;/ /g;
	s/&nbsp;/ /g;
	print;
}

# <b id='text'>Now is the time</b> for <i>all</i> good me&ntilde;.

