mirror of
https://codeberg.org/tacerus/teddit.git
synced 2025-01-09 21:02:36 +01:00
all titles through cleanTitle()
This commit is contained in:
parent
da33b5c456
commit
6f1b88a4c7
@ -94,3 +94,7 @@ meta(name="viewport", content="width=device-width, initial-scale=1.0")
|
|||||||
function secondsToMMSS(time) {
|
function secondsToMMSS(time) {
|
||||||
return new Date(time * 1000).toISOString().substr(14,5)
|
return new Date(time * 1000).toISOString().substr(14,5)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cleanTitle(title) {
|
||||||
|
return title.replace(/&/g, '&')
|
||||||
|
}
|
||||||
|
@ -82,11 +82,11 @@ html
|
|||||||
.title
|
.title
|
||||||
if link.is_self_link
|
if link.is_self_link
|
||||||
a(href="" + link.permalink + "")
|
a(href="" + link.permalink + "")
|
||||||
h2 #{link.title}
|
h2 #{cleanTitle(link.title)}
|
||||||
span (#{link.domain})
|
span (#{link.domain})
|
||||||
else
|
else
|
||||||
a(href="" + link.url + "")
|
a(href="" + link.url + "")
|
||||||
h2 #{link.title}
|
h2 #{cleanTitle(link.title)}
|
||||||
span (#{link.domain})
|
span (#{link.domain})
|
||||||
.meta
|
.meta
|
||||||
p.submitted submitted
|
p.submitted submitted
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
doctype html
|
doctype html
|
||||||
html
|
html
|
||||||
head
|
head
|
||||||
title #{post.title} : #{subreddit}
|
title #{cleanTitle(post.title)} : #{subreddit}
|
||||||
include includes/head.pug
|
include includes/head.pug
|
||||||
body(class=""+ user_preferences.theme +"")
|
body(class=""+ user_preferences.theme +"")
|
||||||
include includes/topbar.pug
|
include includes/topbar.pug
|
||||||
@ -22,7 +22,7 @@ html
|
|||||||
div.arrow.down
|
div.arrow.down
|
||||||
.title
|
.title
|
||||||
a(href="" + localize(post.url) + "")
|
a(href="" + localize(post.url) + "")
|
||||||
h2 #{post.title}
|
h2 #{cleanTitle(post.title)}
|
||||||
p.submitted
|
p.submitted
|
||||||
span(title="" + toUTCString(post.created) + "") submitted #{timeDifference(post.created)} by
|
span(title="" + toUTCString(post.created) + "") submitted #{timeDifference(post.created)} by
|
||||||
a(href="/u/" + post.author + "")
|
a(href="/u/" + post.author + "")
|
||||||
@ -31,7 +31,7 @@ html
|
|||||||
.crosspost
|
.crosspost
|
||||||
.title
|
.title
|
||||||
a(href="" + localize(post.crosspost.permalink) + "")
|
a(href="" + localize(post.crosspost.permalink) + "")
|
||||||
h2 #{post.crosspost.title}
|
h2 #{cleanTitle(post.crosspost.title)}
|
||||||
.num_comments
|
.num_comments
|
||||||
| #{post.crosspost.num_comments} comments
|
| #{post.crosspost.num_comments} comments
|
||||||
.score
|
.score
|
||||||
@ -85,13 +85,13 @@ html
|
|||||||
.video
|
.video
|
||||||
.title
|
.title
|
||||||
a(href="" + post.media.embed_src + "", target="_blank")
|
a(href="" + post.media.embed_src + "", target="_blank")
|
||||||
p #{post.media.title}
|
p #{cleanTitle(post.media.title)}
|
||||||
.video-holder
|
.video-holder
|
||||||
a(href="" + post.media.embed_src + "", target="_blank")
|
a(href="" + post.media.embed_src + "", target="_blank")
|
||||||
img(src="" + post.media.thumbnail + "")
|
img(src="" + post.media.thumbnail + "")
|
||||||
div(class="youtube-info")
|
div(class="youtube-info")
|
||||||
p YouTube video info:
|
p YouTube video info:
|
||||||
p #{post.media.title} <a href="#{post.media.embed_src}">#{post.media.embed_src}</a>
|
p #{cleanTitle(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>
|
||||||
else
|
else
|
||||||
if post.media.source === 'external'
|
if post.media.source === 'external'
|
||||||
|
@ -105,7 +105,7 @@ html
|
|||||||
a(href="" + post.permalink + "")
|
a(href="" + post.permalink + "")
|
||||||
div.no-image
|
div.no-image
|
||||||
.title
|
.title
|
||||||
a(href="" + post.permalink + "") #{post.title}
|
a(href="" + post.permalink + "") #{cleanTitle(post.title)}
|
||||||
.meta
|
.meta
|
||||||
p.submitted(title="" + toUTCString(post.created) + "") submitted #{timeDifference(post.created)} by
|
p.submitted(title="" + toUTCString(post.created) + "") submitted #{timeDifference(post.created)} by
|
||||||
a(href="/u/" + post.author + "") #{post.author}
|
a(href="/u/" + post.author + "") #{post.author}
|
||||||
|
@ -82,11 +82,11 @@ html
|
|||||||
.title
|
.title
|
||||||
if link.is_self_link
|
if link.is_self_link
|
||||||
a(href="" + link.permalink + "")
|
a(href="" + link.permalink + "")
|
||||||
h2 #{link.title}
|
h2 #{cleanTitle(link.title)}
|
||||||
span (#{link.domain})
|
span (#{link.domain})
|
||||||
else
|
else
|
||||||
a(href="" + link.url + "")
|
a(href="" + link.url + "")
|
||||||
h2 #{link.title}
|
h2 #{cleanTitle(link.title)}
|
||||||
span (#{link.domain})
|
span (#{link.domain})
|
||||||
.meta
|
.meta
|
||||||
p.submitted submitted
|
p.submitted submitted
|
||||||
|
@ -78,7 +78,7 @@ html
|
|||||||
a(href="" + post.permalink + "")
|
a(href="" + post.permalink + "")
|
||||||
div.no-image
|
div.no-image
|
||||||
.title
|
.title
|
||||||
a(href="" + post.permalink + "") #{post.title}
|
a(href="" + post.permalink + "") #{cleanTitle(post.title)}
|
||||||
.meta
|
.meta
|
||||||
p.submitted(title="" + toUTCString(post.created) + "") submitted #{timeDifference(post.created)} by
|
p.submitted(title="" + toUTCString(post.created) + "") submitted #{timeDifference(post.created)} by
|
||||||
a(href="/u/" + data.username + "") #{data.username}
|
a(href="/u/" + data.username + "") #{data.username}
|
||||||
@ -89,7 +89,7 @@ html
|
|||||||
.entry
|
.entry
|
||||||
.meta
|
.meta
|
||||||
.title
|
.title
|
||||||
a(href="" + post.url + "") #{post.link_title}
|
a(href="" + post.url + "") #{cleanTitle(post.link_title)}
|
||||||
.author
|
.author
|
||||||
p by
|
p by
|
||||||
if post.link_author !== '[deleted]'
|
if post.link_author !== '[deleted]'
|
||||||
|
Loading…
Reference in New Issue
Block a user