lundi 11 septembre 2017

Custom markup in mobiledoc-kit

I'm using mobiledoc-kit to create an editor. It comes with a few toolbar buttons that let you make text bold, italic etc.. Some text can be wrapped in H1, H2... tags.

What I want is to create a button that will wrap text in a custom tag with attributes (<div data-tag="some data here">TEXT</div>)

I can see the tags are limited in VALID_MARKUP_TAGNAMES constant which is in src/js/models/markup.js file

I installed mobiledoc-kit via npm.

The question is how can I extend this file and add a custom tag to the constant.

I'd appreciate any hint since it is urgent.

Thank you so much




Aucun commentaire:

Enregistrer un commentaire