<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Julain,<br>
<br>
I suppose this is one for you:<br>
<br>
I have a teacher that wants to create a kind of dictionary, so he's
created a big glossary, and then for each letter a separate text
page containing a list of the terms.<br>
<br>
However, the terms are not all transformed into a link. <br>
1. The regular expression doesn't like the sentence ending on a
'newline', I've added '\r' to the set of characters that may 'end' a
term in the RegExp of line 6662 (or the teacher has to add a space
at the end of the term.<br>
<br>
That still is not enough, it will only transform the first term to a
link. I had to remove the \\b from the regexp. I tried to find a
manual page to figure out what \\b means in RegExp, but I can't find
it. Do you have any idea what the \\b is doing there?<br>
<br>
For quick reference I needed to change this:<br>
<br>
if (Glossary.enabled && highlight != false){<br>
for (var i = 0; i<Glossary.terms.length; i++) {<br>
//new code with regexp<br>
var re = new RegExp('\\b(' + Glossary.terms[i] +
')([.,!? -])', 'gi');<br>
myText = myText.replace(re, '<font color =
"'+STYLES.glossaryColour+'"><a class="glossary" href =
"asfunction:_root.engine.rootIcon.showGlosTerm,'+i+'">$1</a></font>$2');<br>
}<br>
}<br>
<br>
into this:<br>
<br>
if (Glossary.enabled && highlight != false){<br>
for (var i = 0; i<Glossary.terms.length; i++) {<br>
//new code with regexp<br>
<font color="#ff0000"> var re = new RegExp('(' +
Glossary.terms[i] + ')([.,!? -\n\r])', 'gi');<br>
</font> myText = myText.replace(re, '<font
color = "'+STYLES.glossaryColour+'"><a class="glossary" href =
"asfunction:_root.engine.rootIcon.showGlosTerm,'+i+'">$1</a></font>$2');<br>
}<br>
}<br>
<pre class="moz-signature" cols="72">--
--
Tom Reijnders
TOR Informatica
Chopinlaan 27
5242HM Rosmalen
Tel: 073 5226191
Fax: 073 5226196
</pre>
</body>
</html>