ckeditor-autocorrect-plugin
ckeditor-autocorrect-plugin copied to clipboard
inclusive replacements, external expansion and a question
-
Great work! my users (2000+) are saving a ton of time using auto-expansion of abbreviations based on your plugin.
-
A quick questions: why don't you use a Map() instead of object literal while defining replacements? (performance? portability?)
-
An enhancement that I already applied in my version: to avoid conflicting (inclusive) replacement keys; e.g. where (AB) would actually might match another replacement key (AAB). why not prefix all keys with a safe prefix e.g. '_', this way AB would never match AAB. e.g. at line 508 of plugin.js
if ( ('_' + sequence) in replacementTable)
at line 510 of plugin.jsreplacement = replacementTable['_' + match];
-
Another Enhancement: How about a hook in the form of call back from the host page to inject contextual content from such page into replacement text, something like, again from line 510 of plugin.js
replacement = contextExpand(replacementTable['_' + match]);
Where contextExpand
will be an overridable function to be replaced by the calling Page ?
this way replacement text can have placeholders e.g. [[CUSTOMER_NAME]] that only the calling page can replace based on whatever information is available to the end user at the time of execution
Again appreciate all your hard work, best of luck ! Cheers