Permalink
Browse files

made highlight plugin configurable

  • Loading branch information...
juliankrispel committed Jun 18, 2017
1 parent e25f78b commit 56e9cb260488b2a3f8fa0b67c86a6531545cb922
Showing with 13 additions and 6 deletions.
  1. +3 −1 src/App.js
  2. +10 −5 src/highlightPlugin/index.js
View
@@ -5,7 +5,9 @@ import createEmojiPlugin from 'draft-js-emoji-plugin';
import createHighlightPlugin from './highlightPlugin';
import 'draft-js-emoji-plugin/lib/plugin.css'
const highlightPlugin = createHighlightPlugin();
const highlightPlugin = createHighlightPlugin({
background: 'purple'
});
const emojiPlugin = createEmojiPlugin();
const { EmojiSuggestions } = emojiPlugin;
@@ -1,13 +1,18 @@
import { RichUtils } from 'draft-js';
export default () => {
const defaultStyle = {
background: 'blue',
padding: '0 .3em',
color: '#fff',
};
export default (style = {}) => {
return {
customStyleMap: {
'HIGHLIGHT': {
background: 'blue',
padding: '0 .3em',
color: '#fff',
}
...defaultStyle,
...style,
},
},
keyBindingFn: (e) => {
if (e.metaKey && e.key === 'h') {

0 comments on commit 56e9cb2

Please sign in to comment.