Open jaufgang opened 9 years ago
adding
if(opts.padMappedWords && char.length >1) char=' '+char+' '
after the chars have been mapped would allow
slug('m&m'); //=> 'mandm' slug('i♥u'); //=> 'iloveu' slug('m&m',{padMappedWords:true}); //=> 'm-and-m' slug('i♥u',{padMappedWords:true}); //=> 'i-love-u'
how about:
slug('i♥u'.replace(/(\w+)/g, " $1 ")); //=> 'i-love-u'
adding
if(opts.padMappedWords && char.length >1) char=' '+char+' '
after the chars have been mapped would allow