Skip to content

Commit

Permalink
Merge pull request #1 from Manvel/change-string-with-slugify
Browse files Browse the repository at this point in the history
valeriangalliat#44 - fixed high vulnerability error
  • Loading branch information
Manvel authored Jun 6, 2018
2 parents cdb048e + e8c6431 commit a806f89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The `opts` object can contain:
Name | Description | Default
------------------|----------------------------------------------------------------|-----------------------------------
`level` | Minimum level to apply anchors on or array of selected levels. | 1
`slugify` | A custom slugification function. | [string.js' `slugify`][slugify]
`slugify` | A custom slugification function. | [`slugify`][slugify]
`permalink` | Whether to add permalinks next to titles. | `false`
`renderPermalink` | A custom permalink rendering function. | See [`index.js`](index.js)
`permalinkClass` | The class of the permalink anchor. | `header-anchor`
Expand All @@ -28,7 +28,7 @@ Name | Description
`permalinkHref` | A custom permalink `href` rendering function. | See [`index.js`](index.js)
`callback` | Called with token and info after rendering. | `undefined`

[slugify]: http://stringjs.com/#methods/slugify
[slugify]: https://www.npmjs.com/package/slugify

The `renderPermalink` function takes the slug, an options object with
the above options, and then all the usual markdown-it rendering
Expand Down
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const string = require('string')
const slugifier = require('slugify')

const slugify = s =>
string(s).slugify().toString()
const slugify = s => slugifier(s, {lower: true})

const position = {
false: 'push',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test": "npm run lint && node test"
},
"dependencies": {
"string": "^3.3.3"
"slugify": "^1.3.0"
},
"devDependencies": {
"markdown-it": "^8.3.0",
Expand Down

0 comments on commit a806f89

Please sign in to comment.