This commit is contained in:
yystopf 2023-03-16 16:09:42 +08:00
parent 9c1b21f246
commit 24fe22398e
1 changed files with 2 additions and 2 deletions

View File

@ -133,7 +133,7 @@ module RepositoriesHelper
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
case k
case k.to_s
when 'ss_src'
content = content.gsub("src=\"#{s[0]}\"", "src=\"#{s_content}\"")
when 'ss_src_1'
@ -145,7 +145,7 @@ module RepositoriesHelper
path = [owner&.login, repo&.identifier, 'tree', ref, file_path].join("/")
s_content = File.expand_path(s_content, path)
s_content = s_content.split("#{Rails.root}/")[1]
case k
case k.to_s
when 'ss_src'
content = content.gsub("src=\"#{s[0]}\"", "src=\"/#{s_content}\"")
when 'ss_src_1'