mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-29 11:09:37 +01:00
fix error while trying to localize an URL
This commit is contained in:
parent
671cf9a324
commit
3edde76303
@ -70,10 +70,12 @@ meta(name="viewport", content="width=device-width, initial-scale=1.0")
|
|||||||
}
|
}
|
||||||
|
|
||||||
function localize(url) {
|
function localize(url) {
|
||||||
let u = new URL(url)
|
try {
|
||||||
if(u.host === 'www.reddit.com' || u.host === 'reddit.com') {
|
let u = new URL(url)
|
||||||
url = url.replace(u.host, 'teddit.net')
|
if(u.host === 'www.reddit.com' || u.host === 'reddit.com') {
|
||||||
}
|
url = url.replace(u.host, 'teddit.net')
|
||||||
|
}
|
||||||
|
} catch(e) { }
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,6 @@ html
|
|||||||
p YouTube video info:
|
p YouTube video info:
|
||||||
p #{post.media.title} <a href="#{post.media.embed_src}">#{post.media.embed_src}</a>
|
p #{post.media.title} <a href="#{post.media.embed_src}">#{post.media.embed_src}</a>
|
||||||
p #{post.media.author_name} <a href="#{post.media.author_url}">#{post.media.author_url}</a>
|
p #{post.media.author_name} <a href="#{post.media.author_url}">#{post.media.author_url}</a>
|
||||||
p
|
|
||||||
else
|
else
|
||||||
if post.media.source === 'external'
|
if post.media.source === 'external'
|
||||||
if post.images
|
if post.images
|
||||||
|
Loading…
Reference in New Issue
Block a user