A tiny module to provide users a WYSIWYG editor
npm install wysiwygA tiny module to turn your textarea into a WYSIWYG editor.
``bash`
$ npm install wysiwyg
`js
var wysiwyg = require('wysiwyg')
var editor = wysiwyg(document.querySelector('textarea'))
editor.selectAll()
editor.bold()
editor.color("pink")
editor.link("foobar.com")
editor.read()
// => hello world
`
When you call it passing a textarea element, it'll:
* Hide the textarea element
* Create an editable wysiwyg element (a.k.a content-editable iframe)
* Copy the current value of the textarea element to the wysiwyg box
* Update the textarea value as make changes on the editor
Listening Updates
`js``
editor.onUpdate(function () {
console.log('content updated')
})
See make-editable