Method: YARD::Templates::Helpers::HtmlHelper#link_url
- Defined in:
- lib/yard/templates/helpers/html_helper.rb
#link_url(url, title = nil, params = {}) ⇒ String
Links to a URL
264 265 266 267 268 269 270 271 272 273 |
# File 'lib/yard/templates/helpers/html_helper.rb', line 264 def link_url(url, title = nil, params = {}) title ||= url title.gsub!(/[\r\n]/, ' ') params = SymbolHash.new(false).update( :href => url, :title => h(title) ).update(params) params[:target] ||= '_parent' if url =~ /^(\w+):\/\// "<a #{tag_attrs(params)}>#{title}</a>".gsub(/[\r\n]/, ' ') end |