Temp = InputStuff.replace(/ \ [ ClueNum\]/g, ClueNum);
---> Temp = InputStuff.replace(/<a href=".../moodle/filter/tex/texdebug.php"><img class="texrender" border="0" title="ClueNum" alt="" src=".../moodle/filter/tex/pix.php/eeed6d5...48.gif" style="vertical-align:middle" /></a>/g, ClueNum);
This unwanted conversion (which results in the HP crossword not working properly) happens in the following conditions:
- the TeX filter has been enabled sitewide by Admin
- a teacher puts a direct link to an HTML Hot Potatoes file placed in the course files
It does not happen if you use the "normal" Moodle interface to point to your HP HTML file, i.e. Add an Actitivy / Hot Potatoes Quiz.
I have identified the culprit (in Moodle 1.6.3). In file \moodle\filter\tex\filter.php line 125:
preg_match_all('/<tex>(.+?)<\/tex>|\$\$(.+?)\$\$|\\\\ \ [ (.+?)\\\\\]|\\[tex\\](.+?)\\[\/tex\\]/is', $text, $matches);
Questions for TeX filter experts (and mathematicians):
- Is the part in red in the preg_match_all really useful in the TeX filter? Or could it be made less greedy and more to the point?
- When the TeX filter is enabled sitewide, could there be a way to prevent it from operating on any uploade HTML resource file, e.g. using a <noTex></noTex> tag similar to the <nolink></nolink> used to prevent dynamic glossary linking?