0
0
Fork 0

Fix #13, Atom feeds now contain formatted post content

This commit is contained in:
Eugen Rochko 2016-03-19 00:16:04 +01:00
parent 580b91c387
commit 071f64d317
5 changed files with 34 additions and 13 deletions

View file

@ -20,17 +20,6 @@ module StreamEntriesHelper
date < 5.days.ago ? date.strftime("%d.%m.%Y") : "#{time_ago_in_words(date)} ago"
end
def linkify(status)
mention_hash = {}
status.mentions.each { |m| mention_hash[m.acct] = m }
coder = HTMLEntities.new
auto_link(coder.encode(status.text), link: :urls, html: { rel: 'nofollow noopener' }).gsub(Account::MENTION_RE) do |m|
account = mention_hash[Account::MENTION_RE.match(m)[1]]
"#{m.split('@').first}<a href=\"#{url_for_target(account)}\" class=\"mention\">@<span>#{account.acct}</span></a>"
end.html_safe
end
def reblogged_by_me_class(status)
user_signed_in? && current_user.account.reblogged?(status) ? 'reblogged' : ''
end