Parser: blank lines should split implicit verses into separate sections #29
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The ChordPro parser (
ChordProParser.kt, line 76) skips blank lines withif (line.isBlank()) continue. This means that songs which use blank lines to separate stanzas (without explicit{start_of_verse}/{end_of_verse}directives) are parsed as a single section containing all lyrics.This is the standard way stanzas are separated in ChordPro files, and the actual song files in the project confirm this pattern — e.g.
am-brunnen-vor-dem-tore.choprohas three stanzas separated by blank lines, but no section directives.As a result,
verseSpacing(the gap between sections) is never applied between stanzas, making the rendered output appear as one continuous block of text.Root Cause
ChordProParser.kt:76:When inside an implicit verse (no explicit
{start_of_verse}was used, butcurrentTypewas set toVERSEat line 162-163), a blank line should flush the current section and allow the next non-blank line to start a new implicit verse.Acceptance Criteria
{start_of_verse}directive), it flushes the current section{start_of_verse}/{end_of_verse}directives still work correctly (blank lines within explicit sections should be ignored, as the section boundary is explicit)Example
Input:
Should produce 2 sections (two VERSE sections), not 1.