fixed readme中图片链接问号处理2

This commit is contained in:
xxq250 2023-06-15 14:43:01 +08:00
parent fca25ff482
commit 328c5c3561
1 changed files with 2 additions and 2 deletions

View File

@ -141,8 +141,8 @@ 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/#{s_content}?ref=#{ref}"].join
s_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw/#{s_content}&ref=#{ref}"].join if s_content.include?("?")
join_xxx = s_content.include?("?") ? "&" : "?"
s_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw/#{s_content}#{join_xxx}ref=#{ref}"].join
case k.to_s
when 'ss_src'
content = content.gsub("src=\"#{s[0]}\"", "src=\"#{s_content}\"")