Hi, Please have a look at the javascript editor here https://github.com/cben/CodeMirror-MathJax/ and the way it handle formula editing. Hint: On the demo, put the cursor just before or after a formula then move it towrds it as you wanted to edit it. Now imagine this applied onto wiki syntax text... -- Dominique