Fix #44: Rename of MD files misses h2 and h3 #54

Merged
SaschaFuksa merged 2 commits from batch/44 into master 2026-04-21 17:24:25 +00:00
Owner
No description provided.
Fix #44: Extract all h1/h2/h3 headings from first 7 lines for filename
Some checks are pending
CI / lint (pull_request) Waiting to run
CI / test (pull_request) Waiting to run
a60f4bdc45
Previously the loop would break after the first heading was found,
so only h1 was captured. Now all three heading levels are extracted
in order from the first 7 lines.

Rules:
- If there is only h1, only use h1
- If there is also a h2 AFTER h1, also add h2
- If there is also a h3 AFTER h2, also add h3
- If there is no h1 but h2, add h2
- If there is no h1 and no h2 but h3, add h3
- If there is no h1, h2 or h3, filename only contains the time component
Tasch self-assigned this 2026-04-21 16:55:42 +00:00
@ -26,2 +34,4 @@
if level == 0:
continue
heading_text = stripped[level:].strip()
if level == 1:
Owner

Please add unit tests with dummy *.md test files

Please add unit tests with dummy *.md test files
Add unit tests with dummy .md test files for _extract_headings_for_filename
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
2242c02b09
Addresses review comment requesting unit tests with dummy *.md test files.
Adds TestExtractHeadingsForFilenameFromFiles class with 9 test cases reading
real .md files from tests/dummy/ directory. Also adds src/api/__init__.py
to fix the relative-import issue discovered during testing.
SaschaFuksa deleted branch batch/44 2026-04-21 17:24:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
Tasch/whisper-transcribe!54
No description provided.