From 3d6c79467f4761bc1e769905875a9bfe2f265821 Mon Sep 17 00:00:00 2001 From: thsparks Date: Thu, 17 Oct 2024 15:55:25 -0700 Subject: [PATCH] Fix code formatting when matching python-template snippets. 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 ""; });