A Rich text editor Model layer. (not finished yet)
import Mekong from 'mekong';
const mekong = new Mekong(document.getElementById('body'));
mekong.useEntity('Paragraph');
// Create paragraph with markup
const p1 = mekong.create('Paragraph', { tag: 'p', attrs: {} });
p1.setText('Hello world!')
p1.setMarkup('strong', 0, 5)
p1.setMarkup('em', 6, 11)
p1.setMarkup('u', 4, 7)
// It gives: <p><strong>Hell<u>o</u></strong> <em class="x1 x2"><u>w</u>orld</em>!</p>
Entity is a building block, such as paragraph, image, table and others.
Mekong utilizes virtual DOM to partially update HTML markup.
gulp build
npm run test