Skip to content

Commit

Permalink
Fix code formatting when matching python-template snippets.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thsparks committed Oct 17, 2024
1 parent de6ec9d commit 3d6c794
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pxtlib/tutorial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
});
Expand Down

0 comments on commit 3d6c794

Please sign in to comment.