From 7529800dc90ce50de7201a97dbc574de61c75985 Mon Sep 17 00:00:00 2001 From: justyannicc Date: Fri, 23 Jan 2026 20:01:43 +0000 Subject: [PATCH] refactor: simplify regex per code review suggestion --- src/auto-reply/heartbeat.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/auto-reply/heartbeat.ts b/src/auto-reply/heartbeat.ts index 2be070727..50567ad87 100644 --- a/src/auto-reply/heartbeat.ts +++ b/src/auto-reply/heartbeat.ts @@ -28,9 +28,10 @@ export function isHeartbeatContentEffectivelyEmpty(content: string | undefined | const trimmed = line.trim(); // Skip empty lines if (!trimmed) continue; - // Skip markdown header lines (# followed by space or alone, ## etc) + // Skip markdown header lines (# followed by space or EOL, ## etc) // This intentionally does NOT skip lines like "#TODO" or "#hashtag" which might be content - if (/^#+\s*$/.test(trimmed) || /^#+\s/.test(trimmed)) continue; + // (Those aren't valid markdown headers - ATX headers require space after #) + if (/^#+(\s|$)/.test(trimmed)) continue; // Found a non-empty, non-comment line - there's actionable content return false; }