site: fix loading REPL with filename containing multiple '.'s (#4441)

pull/4449/head
Alexandre CANTIN 5 years ago committed by GitHub
parent 1772c3f7f1
commit 9a747e3b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,7 +57,10 @@
is_relaxed_gist = data.relaxed; is_relaxed_gist = data.relaxed;
const components = data.files.map(file => { const components = data.files.map(file => {
let [name, type] = file.name.split('.'); const dot = file.name.lastIndexOf(".");
let name = file.name.slice(0, dot);
let type = file.name.slice(dot + 1);
if (type === 'html') type = 'svelte'; // TODO do this on the server if (type === 'html') type = 'svelte'; // TODO do this on the server
return { name, type, source: file.source }; return { name, type, source: file.source };
}); });

Loading…
Cancel
Save