AutoStyleExtension for Medium Editor
Version 2.0.0 is not backwards compatible.
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:
- Words and the CSS style to be applied to these words.
- Words and the CSS class to be applied to these words.
- Whether case matching is to be performed.
- Whether words only are matched, or substrings, too.
Try out the live example.
Installation
npm install medium-editornpm install medium-editor-auto-style-extension
Usage (via NPM)
index.js
MediumEditor = ;AutoStyleExtension = ;
Usage (via Header)
index.html
CömbineStyleAndClass, CombineStyles, CombineClasses, gräy gräyx, oraNGE oraNGEX, ÖÖÖ
Configuration at Runtime
Additional methods allow manipulation of sections during runtime
{ ...} { ...} { ...} { ...} // Applies all config styles to the text.// Useful for triggering via external code. { ...}
Configuration at Runtime: Example
Changing the configuration does not cause re-evaluation of the content implicitly. Call the function applyStyles()
manually to re-evaluate the style of the content.
var extension = editor; extension; extension;
Changelog
2.0.0
- Call
extension.applyStyles()
to apply configuration modification made during runtime - Tried to fix some weired unicode behavious during word matching.
1.1.0
- Allows for CSS- and Class-combination of words present in more than one section.
1.0.0
- Reworked configuration structure
- Added unicode support
- Added configuration modification during runtime
Contributers
This implementation is based on the inbuild AutoLink plugin of Medium Editor.