sym = lookup_tex(match);
if (typeof sym != "undefined") {
- unlocked.innerHTML = pre + sym + " " + post;
- restoreSelection(sym.length - match.length);
+ len1 = unlocked.innerText.length;
+ unlocked.innerHTML = pre + sym + post;
+ len2 = unlocked.innerText.length;
+ restoreSelection(len2 - len1);
return suppressdefault(e,true);
}
else {