I'm using editor js (a block-style editor) for my app. You can install plugins for this editor to extend is functionality. On GitHub there is a math block plugin that I was trying to use there. But I can't get it to work. Hower here is my code:
First I include the plugin (which is the bundle.js on GitHub):
<script type="text/javascript" src="./plugins/editorjs/blocks/math.js"></script><!-- Math -->
Then I just folowed the normal setup (which worked for the other official plugins)
var editor = new EditorJS({
...
tools: {
...
Math: {
class: Math,
},
}
...
});
When I try to type something I get the error TypeError: Math.floor is not a function
. Did I miss something?
Edit
https://flaming-cl.github.io/editorPlugin/
There is this example which works, but I don't understand it, there are so many files. I need more like a basic example with just the necessary CDN files.
Okey, I just remade the Plugin with Katex and it's working fine now. Here is my code, maybe it helps someone. Please keep in mind that this code may have bugs etc...
formala.js
Tools list config
Load the Katext Files and formala.js
Data Input Usage