Skip to content

Commit

Permalink
行頭行末ルビがあると行頭行末タグを消してしまうバグ修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Juna-Idler committed Jul 11, 2021
1 parent f922e31 commit 72300a0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions js/RKLyrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,16 @@ class RubyKaraokeLyricsLine


const array = KaraokeUnit.Parse(textline);
this.start_time = (array[0].start_time >= 0 && array[0].text === "") ? array[0].start_time : -1;
this.end_time = (array.length > 1 && array[array.length-1].text === "" && array[array.length-2].text === "") ?
array[array.length-1].start_time : -1;
if (array[0].start_time >= 0 && (array[0].text === "" || array[0].text.indexOf(atTag.ruby_parent) == 0))
this.start_time = array[0].start_time;
else
this.start_time = -1;

if (array.length > 1 && array[array.length-1].text === "" &&
(array[array.length-2].text === "" || array[array.length-2].text.lastIndexOf(atTag.ruby_end) == (array[array.length-2].text.length - atTag.ruby_end.length)))
this.end_time = array[array.length-1].start_time;
else
this.end_time = -1;
this.start_option = this.start_time >= 0 ? array[0].option : "";
this.end_option = this.end_time >= 0 ? array[array.length-1].option : "";

Expand Down

1 comment on commit 72300a0

@Juna-Idler
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1

Please sign in to comment.