mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-11 18:04:41 +00:00
fix relative hrefs
This commit is contained in:
parent
e737203bab
commit
36abc53ca0
1 changed files with 6 additions and 2 deletions
|
@ -70,8 +70,12 @@ function getHref(hrefTxt) {
|
||||||
if (hrefTxt.indexOf('#') === 0) {
|
if (hrefTxt.indexOf('#') === 0) {
|
||||||
hrefTxt = window.location.href + hrefTxt;
|
hrefTxt = window.location.href + hrefTxt;
|
||||||
}
|
}
|
||||||
|
if (hrefTxt.indexOf('http') !== 0) {
|
||||||
|
var separator = '/';
|
||||||
if (hrefTxt.indexOf('/') === 0) {
|
if (hrefTxt.indexOf('/') === 0) {
|
||||||
hrefTxt = window.location.protocol + '//' + window.location.hostname + hrefTxt;
|
separator = '';
|
||||||
|
}
|
||||||
|
hrefTxt = window.location.protocol + '//' + window.location.hostname + separator + hrefTxt;
|
||||||
}
|
}
|
||||||
// hrefTxt = escape(hrefTxt);
|
// hrefTxt = escape(hrefTxt);
|
||||||
return hrefTxt;
|
return hrefTxt;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue