slackify-markdown
Advanced tools
Comparing version 1.1.1 to 2.0.0
{ | ||
"name": "slackify-markdown", | ||
"version": "1.1.1", | ||
"version": "2.0.0", | ||
"description": "Convert markdown into Slack-specific markdown", | ||
@@ -36,3 +36,2 @@ "license": "MIT", | ||
"dependencies": { | ||
"is-url": "^1.2.4", | ||
"remark-parse": "^5.0.0", | ||
@@ -39,0 +38,0 @@ "remark-stringify": "^5.0.0", |
@@ -40,17 +40,6 @@ # Slackify-Markdown | ||
#### Emojis | ||
Emojis map can be passed through options to replace some specific emoji codes | ||
```js | ||
const options = { | ||
emojis: { ':hello:': ':bye:' } | ||
}; | ||
slackifyMarkdown(':hello: my friend!', options); // -> ':bye: my friend!' | ||
``` | ||
### Copyright and License | ||
Copyright Yevhenii Baraniuk, 2018 | ||
Copyright Yevhenii Baraniuk, 2019 | ||
[MIT Licence](LICENSE) |
const unified = require('unified'); | ||
const parse = require('remark-parse'); | ||
const replaceEmoji = require('./replaceEmoji'); | ||
const slackify = require('./slackify'); | ||
const atlassianEmojis = require('./atlassianEmojis'); | ||
const defaultOptions = { | ||
pedantic: true, | ||
emojis: atlassianEmojis, | ||
}; | ||
@@ -17,3 +14,2 @@ | ||
.use(parse, options) | ||
.use(replaceEmoji, options) | ||
.use(slackify) | ||
@@ -20,0 +16,0 @@ .processSync(markdown) |
const { Compiler } = require('remark-stringify'); | ||
const isURL = require('is-url'); | ||
const { wrap } = require('./utils'); | ||
const { wrap, isURL } = require('./utils'); | ||
@@ -5,0 +4,0 @@ // fixes slack in-word formatting (e.g. hel*l*o) |
@@ -0,1 +1,3 @@ | ||
const { URL } = require('url'); | ||
module.exports = { | ||
@@ -9,2 +11,10 @@ wrap(string, ...wrappers) { | ||
}, | ||
isURL(string) { | ||
try { | ||
return Boolean(new URL(string)); | ||
} catch (error) { | ||
return false; | ||
} | ||
}, | ||
}; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4
5951
7
97
45
1
- Removedis-url@^1.2.4
- Removedis-url@1.2.4(transitive)