Append field with anchor to any block.
- Editor.js v2.20+
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
var editor = EditorJS({
// ...
tools: {
// ...
anchorTune: AnchorBlockTune
},
tunes: ['anchorTune']
// ...
});
var editor = EditorJS({
// ...
tools: {
// ...
anchorTune: AnchorBlockTune,
header: {
class: Header,
tunes: ['anchorTune']
}
}
// ...
});
You can add a localized string
new Editorjs({
// ...
tools: {
anchorTune: AnchorBlockTune
},
i18n: {
tools: {
anchorTune: {
'Anchor': 'Якорь'
}
}
},
})
Example for Header
{
"type": "header",
"data": {
"text": "Header",
"level": 2
},
"tunes": {
"anchorTune": {
"anchor": "header-anchor"
}
}
}