Skip to content

Commit

Permalink
fix(addContent): only process addExtensions once
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
max-nextcloud committed Nov 6, 2024
1 parent d39d041 commit a0555ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mixins/setContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit a0555ac

Please sign in to comment.