Provides Quote Blocks for the Editor.js.
Warning:
This is a fork of the upstream repository, that removes the alignment options, because I already handle alignment using https://github.com/kaaaaaaaaaaai/editorjs-alignment-blocktune, and the two options conflicted. If you want the most up-to-date version of the plugin, or you do need the alignment options, please use the upstream repo instead.
Download the repo and build using Node:
git clone https://github.com/RobinBoers/editorjs-quote
npm i
npm run build
- Move
dist
folder to your project - Add
dist/bundle.js
file to your page
You can load specific version of package from jsDelivr CDN.
https://cdn.jsdelivr.net/npm/@editorjs/quote@latest
Then require this script on page with Editor.js.
<script src="..."></script>
Add a new Tool to the tools
property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
quote: Quote,
},
...
});
Or init Quote Tool with additional settings
var editor = EditorJS({
...
tools: {
...
quote: {
class: Quote,
inlineToolbar: true,
shortcut: 'CMD+SHIFT+O',
config: {
quotePlaceholder: 'Enter a quote',
captionPlaceholder: 'Quote\'s author',
},
},
},
...
});
Field | Type | Description |
---|---|---|
quotePlaceholder | string |
quote's placeholder string |
captionPlaceholder | string |
caption's placeholder string |
Field | Type | Description |
---|---|---|
text | string |
quote's text |
caption | string |
caption or an author |
{
"type" : "quote",
"data" : {
"text" : "The unexamined life is not worth living.",
"caption" : "Socrates"
}
}