users: re-enable username '@' linking in user profiles

このコミットが含まれているのは:
Carl Chenet 2017-05-23 12:48:36 +02:00
コミット 3d54a8ea83
2個のファイルの変更2行の追加7行の削除

ファイルの表示

@ -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))