remove domain name and root slash from extracted id

This commit is contained in:
cloudhead 2010-07-04 21:20:29 +02:00
parent 67dc0498d7
commit 789c829d26

View File

@ -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) {