Module: Gollum::Helpers

Included in:
Filter, Markup
Defined in:
lib/gollum-lib/helpers.rb

Instance Method Summary collapse

Instance Method Details

#trim_leading_slash(url) ⇒ Object



5
6
7
8
9
10
# File 'lib/gollum-lib/helpers.rb', line 5

def trim_leading_slash(url)
  return url if url.nil?
  url.gsub!('%2F', '/')
  return '/' + url.gsub(/^\/+/, '') if url[0, 1] == '/'
  url
end