diff --git a/logseq_cli/commands/analysis.py b/logseq_cli/commands/analysis.py index 177f413..3a33818 100644 --- a/logseq_cli/commands/analysis.py +++ b/logseq_cli/commands/analysis.py @@ -212,6 +212,8 @@ def _is_incidental_page(name: str) -> bool: stripped = name.strip() if len(stripped) < 3: return True + # Also a date in file-name form (2025_10_10, 2025-10-10, 2025/10/10): digits + # and separators only, a journal under another spelling, not a gap. if not any(c.isalpha() for c in stripped): return True if re.fullmatch(r"[\W_]+", stripped): @@ -219,9 +221,6 @@ def _is_incidental_page(name: str) -> bool: # A name opening with punctuation is a tag that swallowed one: "#-AI" if not (stripped[0].isalnum() or stripped[0] in "_@"): return True - # 2025_10_10, 2025-10-10, 2025/10/10 — a journal, not a gap - if re.fullmatch(r"\d{4}[-_/]\d{1,2}[-_/]\d{1,2}", stripped): - return True # An unclosed bracket dragged in from prose: "#Active)", "3b82f6)". if stripped.endswith(")") and "(" not in stripped: return True diff --git a/tests/test_read_only_commands_smoke.py b/tests/test_read_only_commands_smoke.py index 05a11c4..b78b8dd 100644 --- a/tests/test_read_only_commands_smoke.py +++ b/tests/test_read_only_commands_smoke.py @@ -212,7 +212,8 @@ class TestFindKnowledgeGapsIgnoresArtefacts: them, while "596 orphaned pages" reads as a call to action. """ - ARTEFACTS = [")", "-", "1", "272", "-AI", "2025_10_10", "..."] + ARTEFACTS = [")", "-", "1", "272", "-AI", "2025_10_10", "2025-10-10", + "2025/10/10", "..."] def _graph(self, extra=(), trees=None): names = [*self.ARTEFACTS, "Real Knowledge Page", *extra]