formatName - replace spaces with dashes

Name-formatter now replaces spaces with dashes, for more readable names. This is similar to Wordpress' permalink processing.
This commit is contained in:
Ben Yanke 2016-11-15 01:31:28 -06:00 committed by GitHub
parent 3471184828
commit 4bf4d14a24

View file

@ -296,8 +296,10 @@ lbry.formatCredits = function(amount, precision)
}
lbry.formatName = function(name) {
// Converts LBRY name to standard format (all lower case, no special characters)
return name.toLowerCase().replace(/[^a-z0-9\-]/g, '');
// Converts LBRY name to standard format (all lower case, no special characters, spaces replaced by dashes)
name = name.replace(" ", "-");
name = name.toLowerCase().replace(/[^a-z0-9\-]/g, '');
return name;
}
lbry.loadJs = function(src, type, onload)