Skip to content

Commit

Permalink
chore(editor): minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ntacheva committed Jul 24, 2024
1 parent 6fd3e3d commit 351a257
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _contentTemplates/editor/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Modifying the ProseMirror Schema is outside of the Editor scope and we do not pr
#end

#prosemirror-schema-general-info
The Editor accepts a custom ProseMirror schema through its `Schema` parameter. Set this `string` parameter to the name of the JavaScript function that:
The Editor accepts a custom ProseMirror schema through its `Schema` parameter. Set this `string` parameter to the name of a JavaScript function that:

* Is declared in the global scope (the `window` object).
* Returns an instance of the [ProseMirror `Schema` class](https://prosemirror.net/docs/ref/#model.Schema)(the updated schema). You can access this class from the `ProseMirror` object of the event arguments.
Expand Down
5 changes: 4 additions & 1 deletion components/editor/prosemirror-schema/create-new-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ This article describes how you can create a new [ProseMirror schema]({%slug edit

## Plugin Dependencies

Some of the ProseMirror plugins that the Editor uses by design depend on specific nodes in the default ProseMirror schema of the Editor. To get a collection of the used default plugins, use the [`getPlugins` function]({%slug editor-prosemirror-plugins%}#adding-a-custom-plugin).
Some of the ProseMirror plugins that the Editor uses by design depend on specific nodes in the default ProseMirror schema of the Editor. To get a collection of the default plugins, use the [`getPlugins` function]({%slug editor-prosemirror-plugins%}#adding-a-custom-plugin).

When creating a new schema from scratch, it is possible to get an exception if you do not include the needed nodes in your custom schema.

You have two options in this case:

* Include the corresponding nodes in your custom schema.
* Get the collection of default plugins and remove the plugins that require the missing node.
* Pass a [custom empty collection of plugins to the Editor]({%slug editor-prosemirror-plugins%}) to override the built-in ones. Thus,

Note that with the last two options you will lose the functionality that comes with the plugin(s) you remove.

## Creating a New Schema

The below example shows how to:
Expand Down

0 comments on commit 351a257

Please sign in to comment.