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
- Host: GitHub
- URL: https://github.com/godolatunji/html-slack
- Owner: godolatunji
- License: mit
- Created: 2018-03-10T21:51:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T08:50:12.000Z (over 8 years ago)
- Last Synced: 2025-10-25T04:55:01.658Z (8 months ago)
- Topics: conversion, html, html-slack, markdown, slack, slack-html-conversion
- Language: JavaScript
- Homepage:
- Size: 70.3 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'));
```