From dbe80bed8ca15b44d9a7ea9d572340fb60d0944a Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Wed, 29 Oct 2025 08:56:08 +0100 Subject: [PATCH] Nicer error in case of empty Lua expression n directive --- client/codemirror/lua_directive.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/codemirror/lua_directive.ts b/client/codemirror/lua_directive.ts index a5a736a7..c8dfec48 100644 --- a/client/codemirror/lua_directive.ts +++ b/client/codemirror/lua_directive.ts @@ -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 =