remove domain name and root slash from extracted id
This commit is contained in:
parent
67dc0498d7
commit
789c829d26
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user