0
0
Fork 0

Improving feed queries, switching API to doorkeeper authentication

This commit is contained in:
Eugen Rochko 2016-03-11 16:47:36 +01:00
parent b919f39b31
commit 447cfef62d
12 changed files with 50 additions and 11 deletions

View file

@ -23,8 +23,9 @@ module StreamEntriesHelper
def linkify(status)
mention_hash = {}
status.mentions.each { |m| mention_hash[m.acct] = m }
coder = HTMLEntities.new
auto_link(CGI.escapeHTML(status.text), link: :urls, html: { target: '_blank', rel: 'nofollow' }).gsub(Account::MENTION_RE) do |m|
auto_link(coder.encode(status.text), link: :urls, html: { target: '_blank', rel: 'nofollow' }).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