Slate md shortcuts
Markdown shortcuts for slate.js
This repo will insert markdown syntax for certain inline decorations like bold, emphasis, strike, image ,url and inlineCode.
Installation
Install it from npm.
npm i slate-md-shortcuts # yarn yarn add slate-md-shortcuts
Usage
This is not a standard Slate.js plugin, but instead a generic module you can use inside the keydown handler.
Component { const handled = shortcuts if !handled // key was not a markdown shortcut } { return <Editor value= thisstatevalue onChange= thisonChange onKeyDown= thisonKeyDown /> }
Shortcuts
This only adds shortcuts for inline decorations and not for blocks.
Shortcut | Expanded to |
---|---|
Cmd + b |
Bold |
Cmd + i |
Emphasis |
Cmd + k |
Url |
Cmd + Shift + K |
Image |
Cmd + / |
Inline code |
Cmd + Shift + E |
Strike |
Contributing
Everyone is welcome to contribute. Please take a moment to review the contributing guidelines.
Authors & License
thetutlage and contributors.
MIT License, see the included MIT file.