1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

[ci skip] Fix guides to link to edgeapi if on EDGE env

This commit is contained in:
M. Saiqul Haq 2019-04-01 12:47:34 +07:00
parent 43866b2ca3
commit 75aeac9fdf

View file

@ -16,7 +16,7 @@ HTML
end
def link(url, title, content)
if url.start_with?("http://api.rubyonrails.org")
if %r{https?://api\.rubyonrails\.org}.match?(url)
%(<a href="#{api_link(url)}">#{content}</a>)
elsif title
%(<a href="#{url}" title="#{title}">#{content}</a>)
@ -115,7 +115,7 @@ HTML
end
def api_link(url)
if %r{http://api\.rubyonrails\.org/v\d+\.}.match?(url)
if %r{https?://api\.rubyonrails\.org/v\d+\.}.match?(url)
url
elsif edge
url.sub("api", "edgeapi")