diff --git a/lib/less/browser.js b/lib/less/browser.js index 92b9bb15..6cc8c6d7 100644 --- a/lib/less/browser.js +++ b/lib/less/browser.js @@ -200,7 +200,7 @@ function extractUrlParts(url, baseUrl) { // urlParts[4] = filename // urlParts[5] = parameters - var urlPartsRegex = /^((?:[a-z-]+:)?\/\/(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/, + var urlPartsRegex = /^((?:[a-z-]+:)?\/+(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/, urlParts = url.match(urlPartsRegex), returner = {}, directories = [], i, baseUrlParts; @@ -313,7 +313,7 @@ function loadStyleSheet(sheet, callback, reload, remaining) { } function extractId(href) { - return href.replace(/^[a-z]+:\/\/?[^\/]+/, '' ) // Remove protocol & domain + return href.replace(/^[a-z-]+:\/+?[^\/]+/, '' ) // Remove protocol & domain .replace(/^\//, '' ) // Remove root / .replace(/\.[a-zA-Z]+$/, '' ) // Remove simple extension .replace(/[^\.\w-]+/g, '-') // Replace illegal characters