Emulate the default IDE behaviour by only activating links if CTRL (or CMD for Apple) are pressed and the cursor is hovering over a classname.
Do the whole document analyzation in the background, build up an array with pairs of html elements before linking and after linking and switch them out on hover or something....