diff --git a/app/logical/d_text.rb b/app/logical/d_text.rb index ec165638e..c5242d5c6 100644 --- a/app/logical/d_text.rb +++ b/app/logical/d_text.rb @@ -45,7 +45,7 @@ class DText str.gsub!(/\[u\](.+?)\[\/u\]/i, '\1') str.gsub!(/\[tn\](.+?)\[\/tn\]/i, '

\1

') - str = parse_mentions(str) + str = parse_mentions(str, options) str = parse_links(str) str = parse_aliased_wiki_links(str) str = parse_wiki_links(str) @@ -54,7 +54,9 @@ class DText str end - def self.parse_mentions(str) + def self.parse_mentions(str, options = {}) + return if options[:disable_mentions] + str.gsub!(MENTION_REGEXP) do |name| next name unless name =~ /[a-z0-9]/i diff --git a/app/views/artist_commentaries/_show.html.erb b/app/views/artist_commentaries/_show.html.erb index 7be442828..7ef57bdcd 100644 --- a/app/views/artist_commentaries/_show.html.erb +++ b/app/views/artist_commentaries/_show.html.erb @@ -15,7 +15,7 @@

<%= artist_commentary.original_title %>

- <%= format_text(artist_commentary.original_description, :ragel => true) %> + <%= format_text(artist_commentary.original_description, :ragel => true, :disable_mentions => true) %>
<% end %> @@ -31,9 +31,9 @@
<% if artist_commentary.translated_description.present? %> - <%= format_text(artist_commentary.translated_description, :ragel => true) %> + <%= format_text(artist_commentary.translated_description, :ragel => true, :disable_mentions => true) %> <% else %> - <%= format_text(artist_commentary.original_description, :ragel => true) %> + <%= format_text(artist_commentary.original_description, :ragel => true, :disable_mentions => true) %> <% end %>
diff --git a/app/views/artists/show.html.erb b/app/views/artists/show.html.erb index 05f1facce..518c81256 100644 --- a/app/views/artists/show.html.erb +++ b/app/views/artists/show.html.erb @@ -4,7 +4,7 @@ <% if @artist.notes.present? && @artist.visible? %>
- <%= format_text(@artist.notes, :ragel => true) %> + <%= format_text(@artist.notes, :ragel => true, :disable_mentions => true) %>

<%= link_to "View wiki page", @artist.wiki_page %>