Browse Source

tron: ai url, fix double /

pull/584/head
Clement Denis 5 years ago
parent
commit
de8a095abd
  1. 2
      subjects/tron/index.html

2
subjects/tron/index.html

@ -218,7 +218,7 @@ const remoteURL = (login, sha) =>
`https://git.${location.host}/${login}/tron/raw/branch/${sha || 'master'}/ai.js` `https://git.${location.host}/${login}/tron/raw/branch/${sha || 'master'}/ai.js`
const formatURL = url => { const formatURL = url => {
if (url.startsWith('/')) return `${location.pathname}/ai/${url}` if (url.startsWith('/')) return `${location.pathname}/ai${url}`
if (url.startsWith('https://')) return url if (url.startsWith('https://')) return url
if (url.includes(location.hostname)) return `https://${url}` if (url.includes(location.hostname)) return `https://${url}`
return url.includes('@') ? remoteURL(...url.split('@')) : `${location.origin}/${url}` return url.includes('@') ? remoteURL(...url.split('@')) : `${location.origin}/${url}`

Loading…
Cancel
Save