4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/rails_rinku.rb', line 4
def rinku_auto_link(text, *args, &block)
return '' if text.blank?
options = args.size == 2 ? {} : args.
unless args.empty?
options[:link] = args[0] || :all
options[:html] = args[1] || {}
options[:skip] = args[2]
end
options.reverse_merge!(:link => :all, :html => {})
text = h(text) unless text.html_safe?
Rinku.auto_link(
text,
options[:link],
tag_options(options[:html]),
options[:skip],
&block
).html_safe
end
|