Keep litany blocks intact when splitting '_' '/'

This commit is contained in:
Hasinjato 2026-11-30 18:33:06 +03:00
parent ca8d300701
commit 1829fcdb74

View file

@ -2850,9 +2850,13 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
val overrideIterator: MutableMap<Int, Iterator<String>> = mutableMapOf()
try {
val lyrics = getLyricsComments(lyrics)
.replace(Regex("""\$\{L:[^}]*\}""")) {
it.value.replace('_', '\u0001').replace('/', '\u0002')
}
val positionDS = ArrayDeque<Int>()
val arrayLyrics = lyrics.split(Regex("[/_]"))
arrayLyrics.forEachIndexed { i, lyricsItem ->
arrayLyrics.forEachIndexed { i, rawLyricsItem ->
val lyricsItem = rawLyricsItem.replace('\u0001', '_').replace('\u0002', '/')
if (lyricsItem.contains($$"${x:}")) {
positionDS.add(i)
}