[karaoke-split] trim whitespaces around split marker

This commit is contained in:
odrling 2019-08-03 16:36:40 +02:00
parent b56b46cde9
commit 0cd3b823d7
1 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,8 @@ function split_line(subs, sel)
line1 = subs[i]
line2 = subs[i]
line1.text, line2.text = line1.text:match("(.-){split}(.*)")
split_expr = "(.-)%s*{split}%s*(.*)"
line1.text, line2.text = line1.text:match(split_expr)
while line1.text ~= nil do
line1.end_time = line1.start_time + getduration(line1.text)
@ -36,7 +37,7 @@ function split_line(subs, sel)
subs.insert(i, line2)
line1 = subs[i]
line1.text, line2.text = line1.text:match("(.-){split}(.*)")
line1.text, line2.text = line1.text:match(split_expr)
end
end