Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

draft-js-hashtag-plugin

draft-js-plugins1.4kMITdeprecated2.0.4

use @draft-js-plugins/hashtag >=v4 instead

Hashtag Plugin for DraftJS

editor, wysiwyg, draft, react, ux, components, widget, react-component

readme

DraftJS Hashtag Plugin

This is a plugin for the draft-js-plugins-editor.

This plugin highlights hashtags in the text!

Usage

import createHashtagPlugin from 'draft-js-hashtag-plugin';

const hashtagPlugin = createHashtagPlugin();

Importing the default styles

The plugin ships with a default styling available at this location in the installed package: node_modules/draft-js-hashtag-plugin/lib/plugin.css.

Webpack Usage

Follow the steps below to import the css file by using Webpack's style-loader and css-loader.

  1. Install Webpack loaders: npm install style-loader css-loader --save-dev
  2. Add the below section to Webpack config (if your Webpack already has loaders array, simply add the below loader object({test:foo, loaders:bar[]}) as an item in the array).

     module: {
       loaders: [{
         test: /\.css$/,
         loaders: [
           'style-loader', 'css'
         ]
       }]
     }
  3. Add the below import line to your component to tell Webpack to inject style to your component.

     import 'draft-js-hashtag-plugin/lib/plugin.css';
  4. Restart Webpack.

changelog

Change Log

All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

2.0.4

  • Allow draft-js v0.11
  • Remove unused dependencies

2.0.2 - 2.0.3

  • bumped find-with-regex

1.1.0

Changed

  • Deprecated the old regex approach and replaced it with Twitter's hashtag detection strategy. #255 #247 #11

1.0.0 - 2016-04-20

Changed

  • Moved to a flat configuration. Instead of plugin properties (decorators & hooks) being stored within pluginProps they now moved to the root object. See the changes here #150 as well as the initial discussion here #143
  • Moved the option theme from an Immutable Map to a JavaScript object. This is more likely to become a standard.

0.0.4 - 2016-03-25

Released the first working version of DraftJS Hashtag Plugin

It's not recommended to use the version 0.0.0 - 0.0.3