This plugin was originally forked from https://github.com/palerdot/slate-mark, which has a few bugs and hasn't been updated in quite a while. It works out of the box with PlateJS, but still has quite a few bugs. Additionally, in Towns, we have implemented a few features that are not present in the original PlateJS plugin, e.g. @mentions, #channel-hashtags, and emoji support.
Following features were added to the original plugin:
- Nested list support - both ordered and unordered. Initial plugin didn't support nested lists at all. Logic was re-written using depth-first search algorithm with a queue.
- Code block support - initial plugin didn't support code blocks correctly
@mentions
support for users#hashtags
support for channels- emoji support through lookup
- Typescript fixes were added to work with latest PlateJS version
import { plateToMarkdownAsync } from './utils/slateToMD';
const onSend = async () => {
const markdown = await plateToMarkdownAsync(editor.children);
// send markdown to server
}
For more usage, see original README.md in the original repo