This commit is contained in:
Luke Page
2014-11-15 10:12:46 +00:00
2 changed files with 2 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
module.exports = {
extractId: function(href) {
return href.replace(/^[a-z-]+:\/+?[^\/]+/, '' ) // Remove protocol & domain
.replace(/[\?\&]livereload=\w+/,'' ) // Remove LiveReload cachebuster
.replace(/^\//, '' ) // Remove root /
.replace(/\.[a-zA-Z]+$/, '' ) // Remove simple extension
.replace(/[^\.\w-]+/g, '-') // Replace illegal characters