fix(client): replace lookbehind in transformEditorLink (#41889)

This commit is contained in:
Shaun Hamilton
2021-04-22 14:36:33 +01:00
committed by GitHub
parent b439ae7e34
commit 96e8dbc58f

View File

@ -17,11 +17,11 @@ export function isGoodXHRStatus(status) {
export function transformEditorLink(url) {
return url
.replace(
/(?<=\/\/)(?<projectname>[^.]+)\.(?<username>[^.]+)\.repl\.co\/?/,
'replit.com/@$<username>/$<projectname>'
/(\/\/)(?<projectname>[^.]+)\.(?<username>[^.]+)\.repl\.co\/?/,
'//replit.com/@$<username>/$<projectname>'
)
.replace(
/(?<=\/\/)(?<projectname>[^.]+)\.glitch\.me\/?/,
'glitch.com/edit/#!/$<projectname>'
/(\/\/)(?<projectname>[^.]+)\.glitch\.me\/?/,
'//glitch.com/edit/#!/$<projectname>'
);
}