Replace text as you type in CKEditor

1.2k views Asked by At

Is it possible to automatically replace some text with some other directly while typing in CKEditor? Either via plugin, setting or by adding some custom code?

Examples would be to directly replace (c) with ©, or replace double-dash with — (mdash) or even be more specific such as replacing a dash between two digits with – (ndash) if wishing very freely. :)

The use case I have in mind is pretty specific and with few users, so it's ok if the rules are pretty rigid and no way to override, though of course that would be an extra bonus.

I know I could do this while saving or loading etc, but it would be very nice to get the correct result directy just like Google Docs or various desktop programs does it.

Been googling a lot and not really finding any good results for this, perhaps because I don't know the right words to search for. Thankful for any pointers!

2

There are 2 answers

1
rquinn On

I would study the spellcheck as you type (SCAYT) plugin. It's probably 95% of the functionality. They don't do auto correct but if they can underline in red it's darn close.

0
Mari Selvan On

If you want some things that replace automatically then go and pick it up the below plugin.

https://ckeditor.com/cke4/addon/autocorrect

If you go throw the process then you will find more and more useful things that will help you later Process.