X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matitaB%2Fmatita%2Fmatitaweb.js;h=0805e0b9adc297d1e1b5e144388691def7aa4785;hb=e628a830e720c821111706a22e7cb05dc3a6628b;hp=8b607e21adcb897cebea009b3bdcc98075bb2d69;hpb=1f0f5721ea1bae0865b8e2a1e68abb94b5fcd964;p=helm.git diff --git a/matitaB/matita/matitaweb.js b/matitaB/matita/matitaweb.js index 8b607e21a..0805e0b9a 100644 --- a/matitaB/matita/matitaweb.js +++ b/matitaB/matita/matitaweb.js @@ -133,6 +133,12 @@ function restoreSelection() { } } } + +function lookup_tex(texmacro) +{ + texmacro = texmacro.substring(1); + return unescape(macro2utf8[texmacro]); +} function keypress(e) { @@ -146,8 +152,10 @@ function keypress(e) match = unlocked.innerHTML.substring(i,j); pre = unlocked.innerHTML.substring(0,i); post = unlocked.innerHTML.substring(j); - if (match == '\\to') { - unlocked.innerHTML = pre + "-> " + post; + + sym = lookup_tex(match); + if (typeof sym != "undefined") { + unlocked.innerHTML = pre + sym + " " + post; restoreSelection(); return suppressdefault(e,true); }