Basic text Tool for the Editor.js.
Get the package
yarn add @zeainc/editorjs_paragraph_i18nInclude module at your application
import Paragraph_i18n from '@zeainc/editorjs_paragraph_i18n';If you want to connect Paragraph_i18n, do not forget modify the defaultBlock
option of the editor config.
Add a new Tool to the tools property of the Editor.js initial config.
var editor = new EditorJS({
...
tools: {
...
paragraph: {
class: Paragraph_i18n,
inlineToolbar: true,
},
}
...
});The Paragraph_i18n Tool supports these configuration parameters:
| Field | Type | Description |
|---|---|---|
| placeholder | string |
The placeholder. Will be shown only in the first paragraph when the whole editor is empty. |
| preserveBlank | boolean |
(default: false) Whether or not to keep blank paragraphs when saving editor data |
| Field | Type | Description |
|---|---|---|
| text | string |
paragraph's text |
{
"type": "paragraph_i18n",
"data": {
"en": {
"text": "Check out our projects on a <a href=\"https://github.com/codex-team\">GitHub page</a>."
},
"fr": {
"text": "Découvrez nos projets sur <a href=\"https://github.com/codex-team\">GitHub page</a>."
}
}
}