Socket
Socket
Sign inDemoInstall

compose-formatinline

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    compose-formatinline

An inline editing plugin for the Compose editor


Version published
Weekly downloads
4
Maintainers
1
Install size
49.4 kB
Created
Weekly downloads
 

Readme

Source

Compose-formatinline

An inline formatting plugin for the Compose editor.

Usage

This plugin is consumed like any other Compose plugin:

var formatInline = require('compose-formatinline'),
    Compose = require('compose-editor')

var editor = new Compose('#someElement')
editor.use(formatInline)

API

This module exports its functionality on Compose as format-inline:

var inline = editor.require('format-inline')

inline.status( type )

Returns a boolean indicating whether or not the currently selected text has the given type of formatting. If type is one of bold, italic, or code, and the selection is not collapsed, this method returns true if all of the selected text has the given type of formatting. For link formatting, this method behaves a little differently; if the selection is not collapsed, it returns true if there are one or more wholly or partially selected links anywhere in the selection. If the selection is collapsed, the return value of this method indicates whether or not the next input will have the given formatting. If there is no selection, this method returns false.

inline.exec( type [, href ] )

Applies or removes the given type of formatting. When adding link markups, an href should also be passed in. If the selection is collapsed, non-link markups will get applied over the next input; if the selection is collapsed, and the caret is in a link, that link will be removed.

License

MIT

Keywords

FAQs

Last updated on 22 Mar 2015

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