From 1387e1d17ec31005cae13b9f3a55b8120bfec683 Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 21 Apr 2023 14:07:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Areadme=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E4=B8=8D=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/repositories_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index afde12d2c..010197a70 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -88,7 +88,7 @@ module RepositoriesHelper unless r_content.include?("http://") || r_content.include?("https://") || r_content.include?("mailto:") # 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/#{path_current}/#{path_last}&ref=#{ref}"].join end content = content.gsub(/src=\"#{r_content}\"/, "src=\"#{new_r_content}\"").gsub(/src='#{r_content}'/, "src=\"#{new_r_content}\"") rescue @@ -132,7 +132,7 @@ module RepositoriesHelper s_content = File.expand_path(s_content, file_path) s_content = s_content.split("#{Rails.root}/")[1] # content = content.gsub(s[0], "/#{s_content}") - s_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw?filepath=#{s_content}&ref=#{ref}"].join + s_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw/#{s_content}&ref=#{ref}"].join case k.to_s when 'ss_src' content = content.gsub("src=\"#{s[0]}\"", "src=\"#{s_content}\"")