diff --git a/README.md b/README.md index 7b01a85..963bd87 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ toc: - `maxdepth`: Use headings whose depth is at most maxdepth. - `class`: The CSS Class for the toc. (*Default is `false`*) -- `slugify`: Choose which slugify function you want to use. Currently support [uslug](https://github.com/jeremys/uslug) (*Default*) and [transliteration](https://github.com/andyhu/node-transliteration). +- `slugify`: Choose which slugify function you want to use. Currently supported are [uslug](https://github.com/jeremys/uslug) (*Default*), [transliteration](https://github.com/andyhu/node-transliteration) and [slugize](https://github.com/hexojs/hexo-util#slugizestr-options). - `decodeEntities`: Select whether to enable decode entities. ( *Default is `false`* and please see [#15](https://github.com/bubkoo/hexo-toc/pull/15)). - `anchor`: Whether should have an anchor for each headings. (*Default is `false`*) - `position`: Where should the anchor be, `before` the title, or `after` the title. (*Default is `after`*); diff --git a/lib/slugify.js b/lib/slugify.js index 9fcbf40..a1376d6 100644 --- a/lib/slugify.js +++ b/lib/slugify.js @@ -2,6 +2,9 @@ exports.load = function (name) { var slugify; if (name && typeof name === 'string') { switch (name) { + case 'slugize': + slugify = require('hexo-util').slugize; + break; case 'transliteration': slugify = require('transliteration').slugify; break;