Method: HTML::Pipeline::MentionFilter.mentioned_logins_in
- Defined in:
- lib/html/pipeline/@mention_filter.rb
.mentioned_logins_in(text) ⇒ Object
Public: Find user @mentions in text. See MentionFilter#mention_link_filter.
MentionFilter.mentioned_logins_in(text) do |match, login, is_mentioned|
"<a href=...>#{login}</a>"
end
text - String text to search.
Yields the String match, the String login name, and a Boolean determining if the match = “@mention”. The yield’s return replaces the match in the original text.
Returns a String replaced with the return of the block.
30 31 32 33 34 35 |
# File 'lib/html/pipeline/@mention_filter.rb', line 30 def self.mentioned_logins_in(text) text.gsub MentionPattern do |match| login = $1 yield match, login, MentionLogins.include?(login.downcase) end end |