codex-team / codex-team/editor.js
Limiting Instance to One Block Style
- Dominant language
- TypeScript
- Stars
- 31.9k
- Forks
- 2.2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
I want to have a title section on my edit page that only accepts a Header block. This is the code that I have used to implement that:
```
const titleEditor = new EditorJS({
// autofocus: true,
placeholder: "Enter a title...",
holderId: "title-editor",
tools: {
header: {
class: Header,
shortcut: "CMD+SHIFT+H",
config: {
placeholder: "Enter a Header..."
}
}
}
});
```
Now, this basically works like I want. However, it allows me to add multiple titles in that editor. That is, if I type a header and hit return, I can then get the plus icon which allows me to add another header --- and another, etc.
But I don't want that. I want one single header for the page.
How can I modify my code so that I can limit the number of block instances to one?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.