Created
June 4, 2016 03:33
-
-
Save ronisaha/eff5c4fea41f00c3bfc3a877c10abb70 to your computer and use it in GitHub Desktop.
Ckeditor Replace and focus on last/ alternatte http://ckeditor.com/addon/autocorrect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CKEDITOR.on('instanceReady', function(ev) { | |
| var editor = ev.editor; | |
| editor.on('key', function (event) { | |
| setTimeout(function () { | |
| var edata = editor.getData(); | |
| var replaced_text = edata.replace("#1", "one"); // you could also use a regex in the replace | |
| editor.setData('', function () { | |
| editor.insertHtml(replaced_text); | |
| }) | |
| }, 10); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment