From b93f622e9b3426ffc6b8fb4c4e8ff6cf736ac69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20S=2E=20=C5=81ukasiewicz?= Date: Thu, 8 May 2025 15:09:40 +0200 Subject: [PATCH] Render a predefined string for empty markdown table instead of pipe characters (#1387) --- common/markdown_util.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/markdown_util.ts b/common/markdown_util.ts index 96f0e23b..9f5bb11d 100644 --- a/common/markdown_util.ts +++ b/common/markdown_util.ts @@ -60,6 +60,11 @@ export async function jsonToMDTable( } } + // Handle empty case manually, instead of three lines of || + if (headers.size == 0) { + return "*(empty table)*"; + } + const headerList = [...headers]; const lines = []; lines.push(