jakiestfu / Medium.js

A tiny JavaScript library for making contenteditable beautiful (Like Medium's editor)

Home Page:http://jakiestfu.github.io/Medium.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Colorise Specific Words while Typing

xErik opened this issue · comments

commented

Hello!

I like to colorise a specific group of words (house, mouse, ...) in a specific color (red).
Another word group (tree, apple, ...) should be coloured differently (green).

I'd like to checks the words for colouring while typing with the keyup() event.
(keyup() will get debounced for some milliseconds.)

I gave it a shoot by using medium.value(colorizedString)but this causes the caret to jump around.

What would be the appropriate way to achieve this elegantly with Medium?