mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-24 04:20:56 -04:00
+ rewrite "url()" directives in CSS content
This commit is contained in:
parent
5e3c536ece
commit
4ca544960a
@ -291,14 +291,15 @@ static int accessHandlerCallback(void *cls,
|
||||
}
|
||||
pthread_mutex_unlock(&readerLock);
|
||||
|
||||
/* Rewrite the content (add the search box) */
|
||||
/* Special rewrite URL in case of ZIM file use intern *asbolute* url like /A/Kiwix */
|
||||
if (mimeType.find("text/html") != string::npos) {
|
||||
|
||||
/* Special rewrite URL in case of ZIM file use intern *asbolute* url like /A/Kiwix */
|
||||
content = replaceRegex(content, "$1$2" + humanReadableBookId + "/$3/",
|
||||
"(href|src)(=[\"|\']{0,1}/)([A-Z|\\-])/");
|
||||
content = replaceRegex(content, "$1$2" + humanReadableBookId + "/$3/",
|
||||
"(@import[ ]+)([\"|\']{0,1}/)([A-Z|\\-])/");
|
||||
} else if (mimeType.find("text/css") != string::npos) {
|
||||
content = replaceRegex(content, "$1$2" + humanReadableBookId + "/$3/",
|
||||
"(url|URL)(\\([\"|\']{0,1}/)([A-Z|\\-])/");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user