feat(ckeditor/watchdog): ignore parent check (closes #5776)

This commit is contained in:
Elian Doran
2025-12-07 21:59:52 +02:00
parent 7a4f19eada
commit a1c5ed9eb5
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
import { CKEditorError, EditorWatchdog } from "ckeditor5";
const IGNORED_ERRORS = [
// See: https://github.com/TriliumNext/Trilium/issues/5776
"TypeError: Cannot read properties of null (reading 'parent')"
]
export default class CustomWatchdog extends EditorWatchdog {
_isErrorComingFromThisItem(error: CKEditorError): boolean {
for (const ignoredError of IGNORED_ERRORS) {
if (error.message.includes(ignoredError)) {
return false;
}
}
return super._isErrorComingFromThisItem(error);
}
}