users: re-enable username '@' linking in user profiles
This commit is contained in:
джерело
e14d9194c3
коміт
3d54a8ea83
|
@ -346,9 +346,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def linkified_about
|
||||
# most users are probably mentioning "@username" to mean a twitter url, not
|
||||
# a link to a profile on this site
|
||||
Markdowner.to_html(self.about, { :disable_profile_links => true })
|
||||
Markdowner.to_html(self.about)
|
||||
end
|
||||
|
||||
def most_common_story_tag
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
class Markdowner
|
||||
# opts[:allow_images] allows <img> tags
|
||||
# opts[:disable_profile_links] disables @username -> /u/username links
|
||||
|
||||
def self.to_html(text, opts = {})
|
||||
if text.blank?
|
||||
|
@ -10,9 +9,7 @@ class Markdowner
|
|||
exts = [:tagfilter, :autolink, :strikethrough]
|
||||
root = CommonMarker.render_doc(text.to_s, [:SMART], exts)
|
||||
|
||||
unless opts[:disable_profile_links]
|
||||
walk_text_nodes(root) {|n| postprocess_text_node(n)}
|
||||
end
|
||||
walk_text_nodes(root){|n| postprocess_text_node(n) }
|
||||
|
||||
ng = Nokogiri::HTML(root.to_html([:SAFE], exts))
|
||||
|
||||
|
|
Завантаження…
Посилання в новій задачі