@zeainc/editorjs-paragraph-i18n
v1.0.0
Published
Paragraph_i18n Tool for Editor.js
Readme
Paragraph_i18n Tool for Editor.js
Basic text Tool for the Editor.js.
Installation
Get the package
yarn add @zeainc/editorjs_paragraph_i18nInclude module at your application
import Paragraph_i18n from '@zeainc/editorjs_paragraph_i18n';Usage
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,
},
}
...
});Config Params
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 |
Output 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>."
}
}
}