Skip to content

Commit

Permalink
site: fix loading REPL with filename containing multiple '.'s (#4441)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreCantin authored Feb 23, 2020
1 parent 1772c3f commit 9a747e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site/src/routes/repl/[id]/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
is_relaxed_gist = data.relaxed;
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
return { name, type, source: file.source };
});
Expand Down

0 comments on commit 9a747e3

Please sign in to comment.