0
0
Fork 0

Account notes (bios) can now contain links. Character limit upped to 160

This commit is contained in:
Eugen Rochko 2016-11-07 01:14:12 +01:00
parent b835f4aa1c
commit 23fc424b7a
6 changed files with 42 additions and 7 deletions

View file

@ -8,7 +8,7 @@ class Formatter
include ActionView::Helpers::SanitizeHelper
def format(status)
return reformat(status) unless status.local?
return reformat(status.content) unless status.local?
html = status.text
html = encode(html)
@ -20,8 +20,17 @@ class Formatter
html.html_safe
end
def reformat(status)
sanitize(status.content, tags: %w(a br p), attributes: %w(href rel))
def reformat(html)
sanitize(html, tags: %w(a br p), attributes: %w(href rel))
end
def simplified_format(account)
return reformat(account.note) unless account.local?
html = encode(account.note)
html = link_urls(html)
html.html_safe
end
private