readme.md支持图片相对路径
This commit is contained in:
parent
2346b0f848
commit
7f1b95c7d7
|
@ -86,7 +86,7 @@ module RepositoriesHelper
|
||||||
|
|
||||||
unless r_content.include?("http://") || r_content.include?("https://") || r_content.include?("mailto:")
|
unless r_content.include?("http://") || r_content.include?("https://") || r_content.include?("mailto:")
|
||||||
# new_r_content = "#{path}" + new_r_content
|
# new_r_content = "#{path}" + new_r_content
|
||||||
new_r_content = ["base_url", "/api/#{owner&.login}/#{repo.identifier}/raw?filepath=#{path_current}/#{path_last}&ref=#{ref}"].join
|
new_r_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw?filepath=#{path_current}/#{path_last}&ref=#{ref}"].join
|
||||||
end
|
end
|
||||||
content = content.gsub(/src=\"#{r_content}\"/, "src=\"#{new_r_content}\"")
|
content = content.gsub(/src=\"#{r_content}\"/, "src=\"#{new_r_content}\"")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue