Paragraph tool with alignment and RTL support for Editorjs
npm i --save @taiwbi/editorjs-advancedparagraph
If you wish to use it on browser, I recommend to use browserify
After installing the Advanced Paragraph and browserify package with npm run:
browserify -r @taiwbi/editorjs-advancedparagraph > bundle.js
then in your page do this:
<script src="bundle.js"></script>
<script>
const AdvancedParagraph = require("@taiwbi/editorjs-advancedparagraph");
/* ... */
</script>
const editor = new EditorJS({
tools: {
paragraph: {
class: AdvancedParagraph,
inlineToolbar: true,
},
},
});
If you wish to keep default editorjs paragraph and have advanced paragraph beside:
const editor = new EditorJS({
tools: {
AdvancedParagraph: {
class: AdvancedParagraph,
inlineToolbar: true,
},
},
});
if you use editorjs-html you can use built-in parser
const edjsParser = edjsHTML({
paragraph: AdvancedParagraph.AdvancedParagraphParser /*, ...*/,
});