refactor: simplify regex per code review suggestion
This commit is contained in:
parent
c3b025db26
commit
7529800dc9
@ -28,9 +28,10 @@ export function isHeartbeatContentEffectivelyEmpty(content: string | undefined |
|
|||||||
const trimmed = line.trim();
|
const trimmed = line.trim();
|
||||||
// Skip empty lines
|
// Skip empty lines
|
||||||
if (!trimmed) continue;
|
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
|
// 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
|
// Found a non-empty, non-comment line - there's actionable content
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user