The plugin also allows you to validate shortcuts using regular expressions. This can be useful, for example, in blocks
with different variations. Let's look at an example with headers:
Now, when you enter # or ##, the block will be converted to block H1 or H2, respectively.
Retrieving data from an old block
Sometimes it is necessary not only to convert one block into another, but also to preserve the data from the original
block. Below is an example of how to do this:
Notion allows us to convert one heading level to another, but with the default configuration of the converter this will
not be possible. By default, the library compares the old and new block by type, and if the types are the same, then the
conversion will not occur.
To correct this behavior, you can specify your own block comparison function, which, in addition to the type, also
compares the header level:
The npm package editorjs-block-shortcut receives a total of 0 weekly downloads. As such, editorjs-block-shortcut popularity was classified as not popular.
We found that editorjs-block-shortcut demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 21 Nov 2023
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.