mirror of
https://github.com/less/less.js.git
synced 2026-01-25 07:08:17 -05:00
Update lib/less/browser.js
Add support to "file:///" url which could be useful using "--disable-web-security" without a web server.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user