From 53db096e066fff906303fe6cfb8a240003ff556f Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Mon, 24 Feb 2025 10:47:12 -0800 Subject: [PATCH] Ignore empty space when building link grids --- packages/content/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/content/src/index.ts b/packages/content/src/index.ts index e4ec611..4331f0d 100644 --- a/packages/content/src/index.ts +++ b/packages/content/src/index.ts @@ -448,9 +448,9 @@ export const reduceLinks = (content: Parsed[]): Parsed[] => { continue } - if (isNewline(parsed) && buffer.length > 0) { - continue - } + // Ignore newlines and empty space if we're building a grid + if (isNewline(parsed) && buffer.length > 0) continue + if (isText(parsed) && !parsed.value.trim() && buffer.length > 0) continue if (buffer.length > 0) { result.push({type: ParsedType.LinkGrid, value: {links: buffer.splice(0)}, raw: ""})