/content-edit

tools for content editable elements. Inserting html, removing html, position caret, etc...

Primary LanguageJavaScript

content-edit

npm version

tools for content editable elements. Inserting html, removing html, position caret, etc...

Thanks to tim down and his rangy module as most of the code is based on his work.

var contentEdit = require('content-edit');

var el = document.getElementById("content");
contentEdit.placeCaretAtStart(el);

Development

make sure you have babel installed globally to compile the src directory to the lib directory.

npm install --global babel

npm run build

Running Tests server side

modify test.js for any tests

npm install
npm test

Running Tests client side

modify test.js for any tests

npm install

make sure you have webpack installed globally

npm install webpack -g

compile test.js to a bundle with webpack

webpack ./test/test.js ./test/test-bundle.js

open test.html to view the tests in the browser

License

MIT