Provides Block tool for embedded content for the Editor.js. Tool uses embedigo.xyz to handle embeds code.
What is embedigo you can read here
Thanks editor.js team for original embed plugin.
Get the package
npm i --save-dev editorjs-embedigo
Include module at your application
const EditorjsEmbedigo = require('editorjs-embedigo');
Add a new Tool to the tools
property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
embedigo: EditorjsEmbedigo,
},
...
});
Also you need to include embedigo's script into your page
<script async src="//cdn.embedigo.xyz/embed.js" charset="utf-8"></script>
List of supported providers you can find here. All providers enabled by default, you can disable them manually if needed:
var editor = EditorJS({
...
tools: {
...
embedigo: {
class: EditorjsEmbedigo,
config: {
services: {
youtube_video: false,
coub_video: false
}
}
},
},
...
});
Field | Type | Description |
---|---|---|
key | string |
embed unique key |
provider | string |
provider name |
url | string |
source URL |
html | string |
embed html |
caption | string |
content caption |
{
"type" : "embedigo",
"data" : {
"caption": ""
"html": "<div class=\"embedigo-...../>"
"key": "aaf8fc33"
"provider": "twitter_tweet"
"url": "https://twitter.com/freekmurze/status/1313008788593676288"
}
}