Nicer error in case of empty Lua expression n directive

This commit is contained in:
Zef Hemel
2025-10-29 08:56:08 +01:00
parent 496ac5c69d
commit dbe80bed8c
+3
View File
@@ -85,6 +85,9 @@ export function luaDirectivePlugin(client: Client) {
`lua:${text}:${currentPageMeta?.name}`,
text,
async (bodyText) => {
if (bodyText.trim().length === 0) {
return "**Error:** Empty Lua expression";
}
try {
const parsedLua = parseLua(`_(${bodyText})`) as LuaBlock;
const expr =