New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

medium-editor-auto-style-extension

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

medium-editor-auto-style-extension

AutoStyle is an extension for the Medium Editor.

  • 0.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
1
Weekly downloads
 
Created
Source

AutoStyleExtension for Medium Editor

AutoStyleExtension for Medium Editor allows auto-styling of words. The auto-styling is defined by a configuration object, which gets passed to the constructur.

In detail:

  1. Words and the CSS style to be applied to these words,
  2. whether case matching is to be performed,
  3. whether words only are matched, or substrings, too.

Try out the live example.

Installation

npm install medium-editor-auto-style-extension

Usage (via NPM)

index.js

MediumEditor = require('medium-editor');
AutoStyleExtension = require('medium-editor-auto-style-extension');

Usage (vi Header)

index.html


<script type="text/javascript" src="<path>/medium-editor.js"></script>
<script type="text/javascript" src="<path>/auto-style.js"></script>

<div class="editable"></div>

var editor = new MediumEditor('.editable', {
        extensions: {
            'auto-highlight': new AutoStyleExtension({
                config: [{
                    matchcase: false,
                    wordsonly: false,
                    styles: [{
                        style: 'background-color:yellow;',
                        words: ['yellow']
                    }, {
                        style: 'background-color:gray;',
                        words: ['gray', 'grey']
                    }]
                }, {
                    matchcase: true,
                    wordsonly: true,
                    styles: [{
                        style: 'color:red;',
                        words: ['RED']
                    }, {
                        style: 'background-color:orange;',
                        words: ['oraNGE']
                    }]
                }]}
            )
        }
    });

Contributers

This implementation based on the inbuild AutoLink plugin of Medium Editor.

License

MIT

Keywords

FAQs

Package last updated on 15 Oct 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc