diff --git a/web/cm_plugins/lua_widget.ts b/web/cm_plugins/lua_widget.ts index 6f472b7a..6306aaa9 100644 --- a/web/cm_plugins/lua_widget.ts +++ b/web/cm_plugins/lua_widget.ts @@ -66,14 +66,10 @@ export class LuaWidget extends WidgetType { this.client.currentPage, ); activeWidgets.add(this); - if (!widgetContent) { - div.innerHTML = ""; - this.client.setWidgetCache( - this.cacheKey, - { height: div.clientHeight, html: "" }, - ); - return; + if (widgetContent === null || widgetContent === undefined) { + widgetContent = { markdown: "nil" }; } + let html = ""; if (typeof widgetContent !== "object") { // Return as markdown string or number @@ -98,7 +94,7 @@ export class LuaWidget extends WidgetType { } else { // If there is a markdown key, use it, otherwise render the objects as a markdown table let mdContent = widgetContent.markdown; - if (!mdContent) { + if (mdContent === undefined) { mdContent = await renderExpressionResult(widgetContent); } let mdTree = parse( diff --git a/website/Library/Std.md b/website/Library/Std.md index 7f8f07d6..1827f502 100644 --- a/website/Library/Std.md +++ b/website/Library/Std.md @@ -2,5 +2,5 @@ This is the start of the standard library distributed as part of SilverBullet co ${template.each(query[[ from index.tag "page" - where name:startsWith("Library/Std") + where name:startsWith("Library/Std/") ]], templates.pageItem)} \ No newline at end of file