handlebars-helper-slugify
Version:
{{slugify}} handlebars helper. Uses the awesome underscore.string to transform text into a URL slug. Replaces whitespaces, accentuated and special characters with a dash.
22 lines (17 loc) • 469 B
JavaScript
/**
* slugify
*/
var expect = require('chai').expect;
var slugify = require('./slugify');
describe('slugify', function() {
it('should do something awesome', function() {
var actual = slugify('foo bar baz');
var expected = 'foo-bar-baz';
expect(actual).to.eql(expected);
});
it('should do something awesome', function() {
var actual = slugify('-foo bar baz-');
var expected = 'foo-bar-baz';
expect(actual).to.eql(expected);
});
});