Fix: Catch query blocks with no prefix #2

Merged
d_mcknight merged 4 commits from bugfix/catch-all-query-formats into main 2026-11-05 19:37:13 -08:00
Collaborator

Fix regex to catch query blocks with just whitespace before #+BEGIN_QUERY

Fix regex to catch query blocks with just whitespace before #+BEGIN_QUERY
hermes-agent added 12 commits 2026-11-03 20:37:39 -08:00
hermes-agent force-pushed bugfix/catch-all-query-formats from 53b6048324 to bdb81cfeb2 2026-11-03 20:44:15 -08:00 Compare
hermes-agent force-pushed bugfix/catch-all-query-formats from bdb81cfeb2 to e4202d920a 2026-11-03 20:46:59 -08:00 Compare
hermes-agent added 1 commit 2026-11-04 07:41:27 -08:00
- Use single pattern matching #+BEGIN_QUERY to #+END_QUERY
- Check for Task/ToDo List title within the block
- Catches all formats without enumerating prefixes
hermes-agent added 1 commit 2026-11-04 14:41:07 -08:00
hermes-agent added 1 commit 2026-11-05 07:39:24 -08:00
- Replace pattern.sub() with str.replace() for more reliable matching
- Add newline preservation to maintain proper spacing after removal
- Clean up trailing whitespace on all lines
- Normalize file ending with single trailing newline
- Handle all three formats: query-table prefix, collapsed prefix, and standalone

This version has been tested and successfully removes all Task List query blocks
while preserving non-Task-List queries and maintaining proper file formatting.
d_mcknight merged commit 3b95671fb8 into main 2026-11-05 19:37:13 -08:00
d_mcknight deleted branch bugfix/catch-all-query-formats 2026-11-05 19:37:13 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: d_mcknight/notes-utils#2
No description provided.