From 3bba3e16f1aef484eb4a9bbc2677e4503554d68e Mon Sep 17 00:00:00 2001 From: Thomas Sparks <69657545+thsparks@users.noreply.github.com> Date: Fri, 18 Oct 2024 09:25:50 -0700 Subject: [PATCH] Fix code formatting when matching python-template snippets. (#10237) Because we were only checking the snippet match for "python" and not "python-template", we were adding { } that are (I suppose) expected for typescript but break python parsing. I've gone with the more general language check here instead of just adding another case in the hopes that it will be more future-proof if we add any more possible keywords. --- pxtlib/tutorial.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxtlib/tutorial.ts b/pxtlib/tutorial.ts index cc14761415b..abd02d4cc41 100644 --- a/pxtlib/tutorial.ts +++ b/pxtlib/tutorial.ts @@ -148,7 +148,7 @@ namespace pxt.tutorial { m2 = ""; break; } - code.push(m1 == "python" ? `\n${m2}\n` : `{\n${m2}\n}`); + code.push(language === "python" ? `\n${m2}\n` : `{\n${m2}\n}`); idx++ return ""; });