+ var s = string_of_key(e.charCode);
+ if (s == " ") {
+ j = getCursorPos();
+ i = unlocked.innerHTML.lastIndexOf('\\',j);
+ if (i >= 0) {
+ match = unlocked.innerHTML.substring(i,j);
+ pre = unlocked.innerHTML.substring(0,i);
+ post = unlocked.innerHTML.substring(j);
+
+ sym = lookup_tex(match);
+ if (typeof sym != "undefined") {
+ len1 = unlocked.innerText.length;
+ unlocked.innerHTML = pre + sym + post;
+ len2 = unlocked.innerText.length;
+ restoreSelection(len2 - len1);
+ return suppressdefault(e,true);
+ }
+ else {
+ // restoreSelection(0);
+ return suppressdefault(e,false);
+ }
+ }
+ else return suppressdefault(e,false);
+ } else {
+ return suppressdefault(e,false);
+ }