An open API service indexing awesome lists of open source software.

https://github.com/godolatunji/html-slack

An html to slack conversion utility that supports a wide array of html tags, converting them to slack suitable markdown
https://github.com/godolatunji/html-slack

conversion html html-slack markdown slack slack-html-conversion

Last synced: about 2 months ago
JSON representation

An html to slack conversion utility that supports a wide array of html tags, converting them to slack suitable markdown

Awesome Lists containing this project

README

          

# html-slack
This package converts html to slack markdown with support for more html tags and conforming them to slack standard markdown.

#How to use
```js
const h2s = require("html-slack");

// a header tag
// ============
console.log(h2s("

a header tag"));

// *a strong text*
console.log(h2s("a strong text"))
```

# html tags support
The following tags are supported
1. All header tags - they are underlined on conversion
2. div and p tags
3. del, s and strike tags - converted using ~text~ format
4. mark and q tags - converted using \`text\` format
5. the i and em tags - converted using \_text\_ format
6. the blockquote and pre tags.
7. the ol and ul tags
8. u tag

# To-do
- conversion of table

# Extra
The converter also takes care of element with `text-decoration` style attribute.
For example:
```js
// ~this is a deleted text~
console.log(h2s('this is a deleted text'));

// `_this is an underlined text_`
console.log(h2s('this is a underlined text'));
```