mirror of
https://github.com/neocities/neocities.git
synced 2025-08-04 08:42:00 +02:00
improvements to surf mode
This commit is contained in:
parent
3a157b697f
commit
2c3441d791
2 changed files with 18 additions and 14 deletions
10
app/surf.rb
10
app/surf.rb
|
@ -44,9 +44,13 @@ get %r{\/surf\/proxy\/([\w-]+)\/(.+)|\/surf\/proxy\/([\w-]+)\/?} do
|
|||
|
||||
new_ele = nil
|
||||
|
||||
if uri.match /^\//
|
||||
new_ele = ele.gsub(uri, "#{$config['surf_proxy_uri']}/surf/proxy/#{site.username}#{uri}")
|
||||
elsif !uri.match /^\w+:\/\//
|
||||
if uri.match(/^\w+:\/\/|^\/\//i)
|
||||
if ele.match(/^href/i)
|
||||
new_ele = ele + ' target="_blank"'
|
||||
else
|
||||
new_ele = ele
|
||||
end
|
||||
else
|
||||
new_ele = ele.gsub(uri, "#{$config['surf_proxy_uri']}/surf/proxy/#{site.username}/#{uri}")
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue