Skip to content

Commit b619ceb

Browse files
AlexandreCantinjesseskinner
authored andcommitted
site: fix loading REPL with filename containing multiple '.'s (sveltejs#4441)
1 parent 8b3d0f5 commit b619ceb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

site/src/routes/repl/[id]/index.svelte

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@
5757
is_relaxed_gist = data.relaxed;
5858
5959
const components = data.files.map(file => {
60-
let [name, type] = file.name.split('.');
60+
const dot = file.name.lastIndexOf(".");
61+
let name = file.name.slice(0, dot);
62+
let type = file.name.slice(dot + 1);
63+
6164
if (type === 'html') type = 'svelte'; // TODO do this on the server
6265
return { name, type, source: file.source };
6366
});

0 commit comments

Comments
 (0)