diff --git a/lib/less/browser.js b/lib/less/browser.js index cdcff5a..310e5ce 100644 --- a/lib/less/browser.js +++ b/lib/less/browser.js @@ -146,10 +146,11 @@ function loadStyleSheet(sheet, callback, reload, remaining) { } function extractId(href) { - return href.replace(/^[a-z]+:\/\/?/, '') // Remove protocol - .replace(/\?.*$/, '') // Remove query - .replace(/\.[^\/]+$/, '') // Remove file extension - .replace(/[^\w-]+/g, '-'); // Replace illegal characters + return href.replace(/^[a-z]+:\/\/?[^\/]+/, '') // Remove protocol & domain + .replace(/^\//, '') // Remove root / + .replace(/\?.*$/, '') // Remove query + .replace(/\.[^\/]+$/, '') // Remove file extension + .replace(/[^\w-]+/g, '-'); // Replace illegal characters } function createCSS(styles, sheet, lastModified) {