Disable CKEditor's spellchecker

This commit is contained in:
Aljaž Grilc 2024-04-04 07:53:20 +02:00
parent 2c7a8f0c48
commit dcda2d89dc

View File

@ -639,6 +639,7 @@ class BesCKService extends BesService {
constructor(hostElement, ckEditorInstance) {
super(hostElement)
this.ckEditorInstance = ckEditorInstance
this.disableCKEditorSpellcheck(ckEditorInstance)
}
/**
@ -654,6 +655,21 @@ class BesCKService extends BesService {
return service
}
/**
* This function disables the CKEditor spellcheck.
*
* @param {CKEditorInstance} ckInstance
*/
disableCKEditorSpellcheck(ckInstance) {
ckInstance.editing.view.change(writer => {
writer.setAttribute(
'spellcheck',
'false',
ckInstance.editing.view.document.getRoot()
)
})
}
/**
* Marks given block element as grammar-proofed.
*