Socket
Socket
Sign inDemoInstall

quill-placeholder-module

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    quill-placeholder-module

Quill module for inserting placeholders


Version published
Weekly downloads
2.8K
decreased by-2.01%
Maintainers
1
Install size
53.9 kB
Created
Weekly downloads
 

Readme

Source

quill-placeholder-module

Quill module for adding placeholders. Demo

Install

npm install --save quill-placeholder-module

Usage

import getPlaceholderModule from 'quill-placeholder-module'
// es5
var getPlaceholderModule = require('quill-placeholder-module').default
// umd
var getPlaceholderModule = PlaceholderModule.default

Quill.register('modules/placeholder', getPlaceholderModule(Quill, {
  className: 'ql-placeholder-content'  // default
})

var quill = new Quill('#editor', {
  modules: {
    toolbar: {container: `#toolbar`},
    placeholder: {
      delimiters: ['{', '}'],  // default
      placeholders: [
        {id: 'foo', label: 'Foo'},
        {id: 'required', label: 'Required', required: true}
      ]
    }
  },
  placeholder: 'Compose an epic...',
  theme: 'snow'  // or 'bubble'
});

Define the toolbar menu (a more complete example can be found in the demo):

<div id="toolbar">
  <select class="ql-placeholder">
    <option value="foo">Foo</option>
    <option value="required">Required</option>
  </select>
</div>
<div id="editor"></div>

And include the css from dist/toolbar.css.

The markup will contain (with default options) <span class="ql-placeholder-content" data-id="placeholder-id" data-label="placeholder-label">...</span>

To transform the output check out https://github.com/jspaine/html-ast-transform

Keywords

FAQs

Last updated on 20 May 2018

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