Socket
Socket
Sign inDemoInstall

wysiwyg

Package Overview
Dependencies
5
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wysiwyg

A tiny module to provide users a WYSIWYG editor


Version published
Weekly downloads
3
decreased by-91.67%
Maintainers
1
Install size
20.5 kB
Created
Weekly downloads
 

Readme

Source

wysiwyg

A tiny module to turn your textarea into a WYSIWYG editor.

Demo @RequireBin

Install

$ npm install wysiwyg

Usage

var wysiwyg = require('wysiwyg')

var editor = wysiwyg(document.querySelector('textarea'))

editor.selectAll()
editor.bold()
editor.color("pink")
editor.link("foobar.com")

editor.read()
// => <b><a href="foobar.com" style="color: pink">hello world</a></b>

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

editor.onUpdate(function () {
  console.log('content updated')
})

Reference

See make-editable

Keywords

FAQs

Last updated on 09 Apr 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc