mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-05-17 19:02:31 +12:00
Fix url decoding issue. Fixes #19
This commit is contained in:
parent
d3dbcc150b
commit
6e4ef46f7e
|
@ -491,7 +491,7 @@ class FimFic2Epub extends Emitter {
|
|||
|
||||
for (let ma; (ma = matchUrl.exec(html));) {
|
||||
let url = ma[1]
|
||||
let cleanurl = decodeURI(entities.decode(url))
|
||||
let cleanurl = entities.decode(url)
|
||||
if (this.remoteResources.has(cleanurl)) {
|
||||
let r = this.remoteResources.get(cleanurl)
|
||||
if (r.where.indexOf(where) === -1) {
|
||||
|
|
|
@ -37,10 +37,12 @@ export async function cleanMarkup (html) {
|
|||
html = html.replace('<blockquote style="margin: 10px 0px; box-sizing:border-box; -moz-box-sizing:border-box;margin-right:25px; padding: 15px;background-color: #F7F7F7;border: 1px solid #AAA;width: 50%;float:left;box-shadow: 5px 5px 0px #EEE;">', '<blockquote class="left_insert">')
|
||||
html = html.replace('<blockquote style="margin: 10px 0px; box-sizing:border-box; -moz-box-sizing:border-box;margin-left:25px; padding: 15px;background-color: #F7F7F7;border: 1px solid #AAA;width: 50%;float:right;box-shadow: 5px 5px 0px #EEE;">', '<blockquote class="right_insert">')
|
||||
|
||||
/*
|
||||
let imageEmbed = /<img data-src="(.*?)" class="user_image" src="(.*?)" data-lightbox\/>/g
|
||||
html = await replaceAsync(html, imageEmbed, (match, originalUrl, cdnUrl) => {
|
||||
return render(m('img', {src: entities.decode(cdnUrl), alt: 'Image'}), {strict: true})
|
||||
})
|
||||
*/
|
||||
|
||||
// Fix links pointing to pages on fimfiction
|
||||
// Example: <a href="/user/djazz" rel="nofollow">djazz</a>
|
||||
|
|
Loading…
Reference in a new issue