Given a set of defined terms, and a text, search for
occurences of the terms, and if they match, mark them up as links reffering
to the definition.
Terms consist of a sequence of non-whitespace characters.
The marking up consists of putting a fixed string in front of the term, then a second fxied string, then teh term again, and then a final string:
HTML does not permit nested "anchors". So terms must not overlap.... given
Further we want to substitute the longest term in preferrence to the shorter ones. This makes the following reult incorrect:
Scan the text, with each term watching to see if it is the matching term.
When there is more than one term macthing, continue the scan. They drop
out, until: there is one perfect match or none left. If there is one
then fix it up, other wise, reset every thing, output the non-term
Treat each term as a separate entity. Each is responsible for
recognizing whether or not it is a match.