Skip to content

Commit dd2245b

Browse files
committed
fix matching on titleize
1 parent 503ca83 commit dd2245b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/string.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@ helpers.startsWith = function(prefix, str, options) {
595595

596596
helpers.titleize = function(str) {
597597
if (!util.isString(str)) return '';
598-
var title = str.replace(/[ \-_]+/g, ' ');
599-
var words = title.match(/\w+/g);
598+
var title = str.replace(/[- _]+/g, ' ');
599+
var words = title.split(' ');
600600
var len = words.length;
601601
var res = [];
602602
var i = 0;

0 commit comments

Comments
 (0)