Keep litany blocks intact when splitting '_' '/'
This commit is contained in:
parent
ca8d300701
commit
1829fcdb74
1 changed files with 5 additions and 1 deletions
|
|
@ -2850,9 +2850,13 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
val overrideIterator: MutableMap<Int, Iterator<String>> = mutableMapOf()
|
val overrideIterator: MutableMap<Int, Iterator<String>> = mutableMapOf()
|
||||||
try {
|
try {
|
||||||
val lyrics = getLyricsComments(lyrics)
|
val lyrics = getLyricsComments(lyrics)
|
||||||
|
.replace(Regex("""\$\{L:[^}]*\}""")) {
|
||||||
|
it.value.replace('_', '\u0001').replace('/', '\u0002')
|
||||||
|
}
|
||||||
val positionDS = ArrayDeque<Int>()
|
val positionDS = ArrayDeque<Int>()
|
||||||
val arrayLyrics = lyrics.split(Regex("[/_]"))
|
val arrayLyrics = lyrics.split(Regex("[/_]"))
|
||||||
arrayLyrics.forEachIndexed { i, lyricsItem ->
|
arrayLyrics.forEachIndexed { i, rawLyricsItem ->
|
||||||
|
val lyricsItem = rawLyricsItem.replace('\u0001', '_').replace('\u0002', '/')
|
||||||
if (lyricsItem.contains($$"${x:}")) {
|
if (lyricsItem.contains($$"${x:}")) {
|
||||||
positionDS.add(i)
|
positionDS.add(i)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue