Skip to content

Close #16: stop source_labels=False from delegating to wrong archetype formatter - #169

Merged
prekabreki merged 1 commit into
mainfrom
foreman/issue-16
Aug 2, 2026
Merged

Close #16: stop source_labels=False from delegating to wrong archetype formatter#169
prekabreki merged 1 commit into
mainfrom
foreman/issue-16

Conversation

@prekabreki

Copy link
Copy Markdown
Owner

What changed

Removed the two early-exit delegations in _format_document_archive and _format_mixed_media that re-routed source_labels=False to wrong archetype formatters. Now both functions always use their own classification paths and only suppress SOURCE_LABEL_OPEN/SOURCE_LABEL_CLOSE blocks when the toggle is off.

Files

  • vo_format/formatter.py - Removed delegating return _format_single_narrator(...) at L803-804 and return _format_multi_voice_drama(...) at L1076-1077; guarded all SOURCE_LABEL_OPEN/SOURCE_LABEL_CLOSE appends with if toggles.source_labels:
  • tests/test_formatter.py - Added two regression tests asserting (block_type, text) sequence equality between on-run (labels stripped) and off-run for both document_archive_sample.md and mixed_media_sample.md

Assumptions made

  • in_source_block tracking is preserved for indentation purposes even when labels are suppressed
  • RE_DOC_REF matching and document_section/narrative_label handling proceed unchanged - only the label container blocks are conditional

Uncertainties

None

Test

./.venv/Scripts/python.exe -m pytest tests/ -q - 461 passed, 2 skipped

@prekabreki
prekabreki merged commit 52c5873 into main Aug 2, 2026
7 checks passed
@prekabreki
prekabreki deleted the foreman/issue-16 branch August 2, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant