mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-11 01:44:44 +00:00
fix relative URLs bugs
This commit is contained in:
parent
e7aab8cd00
commit
c752f7a3b6
2 changed files with 32 additions and 30 deletions
|
@ -163,14 +163,14 @@ function sanitize(rawContentString) {
|
|||
tattrs = attrs.filter(function(attr) {
|
||||
return attr.name === 'src';
|
||||
}).map(function(attr) {
|
||||
return getImageSrc(decodeHtmlEntity(attr.value));
|
||||
return getImageSrc(attr.value);
|
||||
});
|
||||
lastFragment = tattrs.length === 0 ? '<img></img>' : '<img src="' + tattrs[0] + '" alt=""></img>';
|
||||
} else if (tag === 'a') {
|
||||
tattrs = attrs.filter(function(attr) {
|
||||
return attr.name === 'href';
|
||||
}).map(function(attr) {
|
||||
return getHref(decodeHtmlEntity(attr.value));
|
||||
return getHref(attr.value);
|
||||
});
|
||||
lastFragment = tattrs.length === 0 ? '<a>' : '<a href="' + tattrs[0] + '">';
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue