Fix play button on some code

This commit is contained in:
luk3yx 2025-02-27 17:51:31 +13:00
parent 434c4f8fdf
commit 2c94fae57d

View File

@ -36,7 +36,7 @@ function addPlayBtn({el, result, text}) {
if (text.indexOf("style = {") > 0 || text.indexOf("gui.Style") > 0) if (text.indexOf("style = {") > 0 || text.indexOf("gui.Style") > 0)
return; return;
if (text.startsWith("gui.")) { if (text.startsWith("gui.") && text.trim().endsWith("}")) {
addPlaygroundBtn(el, TEMPLATE.replace("%", addPlaygroundBtn(el, TEMPLATE.replace("%",
" return " + text.trim().replaceAll("\n", "\n "))); " return " + text.trim().replaceAll("\n", "\n ")));
} else if (/^local (my_gui|form) = flow.make_gui\(function\(player, ctx\)\n/.test(text) && } else if (/^local (my_gui|form) = flow.make_gui\(function\(player, ctx\)\n/.test(text) &&