[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
1 changed files with 2 additions and 2 deletions

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")