Sha256: 42cee05edf7c6f8c5e3a09dcaa8d97642f392b67a3799ccce394e8f678ddbad1

Contents?: true

Size: 396 Bytes

Versions: 1

Compression:

Stored size: 396 Bytes

Contents

AutoHtml.add_filter(:hashtag).with(:source => :twitter) do |text, options|
  if options[:source] == :twitter
    text.gsub(/#([^ ]+)/, '<a href="http://twitter.com/search?q=%23\1&f=realtime" class="hashtag" target="_blank">#\1</a>')
  elsif options[:source] == :facebook
    text.gsub(/#([^ ]+)/, '<a href="https://www.facebook.com/hashtag/\1" class="hashtag" target="_blank">#\1</a>')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
auto_html-1.6.1 lib/auto_html/filters/hashtag.rb