From a0555ac4307dd7717159b3c82b533e56386c45d1 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 5 Nov 2024 10:37:44 +0100 Subject: [PATCH] fix(addContent): only process addExtensions once Use `editor.options.extensions`. This only includes the extensions that were configured when instantiating the editor. It does not include the extensions these extensions added. `generateJSON` will process the provided extensions and add extensions according to their `addExtensions` field. Before we used `editor.editorManager.extensions` which includes all extensions used in the editor including those added by other extensions. This lead to `generateJSON` adding the same extensions again which resulted in a warning. Signed-off-by: Max --- src/mixins/setContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixins/setContent.js b/src/mixins/setContent.js index addf6aee02c..2ccfa4c7b1b 100644 --- a/src/mixins/setContent.js +++ b/src/mixins/setContent.js @@ -34,7 +34,7 @@ export default { const editor = createEditor({ enableRichEditing: isRichEditor, }) - const json = generateJSON(html, editor.extensionManager.extensions) + const json = generateJSON(html, editor.options.extensions) const doc = Node.fromJSON(editor.schema, json) const getBaseDoc = (doc) => {