https://github.com/mayashavin/markdown-it-slack
Plugin for Markdown-it to override default CommonMark standards to Slack standards
https://github.com/mayashavin/markdown-it-slack
Last synced: about 1 year ago
JSON representation
Plugin for Markdown-it to override default CommonMark standards to Slack standards
- Host: GitHub
- URL: https://github.com/mayashavin/markdown-it-slack
- Owner: mayashavin
- License: mit
- Created: 2019-03-25T17:14:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-05T09:20:42.000Z (about 7 years ago)
- Last Synced: 2025-05-12T23:49:34.164Z (about 1 year ago)
- Language: JavaScript
- Size: 54.7 KB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slack-markdown-it
#### 🚀 This plugin overrides default **Github style** to [**Slack style**](https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages) for syntax parser of the following:
1. **Bold** (Using * bold * for strong emphasis instead of ** bold ** or __ bold __)
2. _Italic_ (Using _ italic _ for emphasis instead of * bold *)
3. ~~Strikethrough~~ (Using ~ strikethrough ~ instead of ~~ strikethrough ~~)
Demo: [https://codesandbox.io/embed/j2y24r3yq9](https://codesandbox.io/embed/j2y24r3yq9)
## How to install 🛠️
1. It's written as plugin for [Markdown](https://github.com/markdown-it/markdown-it) so it requires `markdown-it` to be installed.
```
npm install markdown-it --save
yarn add markdown-it
```
2. Install using `npm` or `yarn`
```
npm install slack-markdown-it --save
yarn add slack-markdown-it
```
## How to use 👨💻
### Using `import`
```js
import Markdown from "markdown-it";
import MarkdownSlack from 'slack-markdown-it';
const md = Markdown();
md.use(MarkdownSlack);
md.renderInline(`*This is me in bold*, and he is in _italic_. Don't ~strikethrough~ me!`)
```
### Using `require`
```js
const md = require('markdown-it')();
md.use(require('slack-markdown-it'));
md.renderInline(`*This is me in bold*, and he is in _italic_. Don't ~strikethrough~ me!`)
```
## Coming soon 🏹 👩🔬
* Customize which syntax to override.
* Optimization for tag rendering.
* Test coverage.
## License
[MIT](https://github.com/mayashavin/markdown-it-slack/blob/master/LICENSE)