Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
improve sub parsing reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaUnknown committed Aug 22, 2021
1 parent 546cf6b commit f30b479
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bundle.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,8 @@ Style: Default,${options.defaultSSAStyles || 'Roboto Medium,26,&H00FFFFFF,&H0000
if (isAss) {
callback(subtitles)
} else {
for (const split of buffer.toString().split('\n\n')) {
const text = buffer.toString().replace(/\r/g, '')
for (const split of text.split('\n\n')) {
const match = split.match(regex)
if (match) {
match[1] = match[1].match(/.*[.,]\d{2}/)[0]
Expand Down

0 comments on commit f30b479

Please sign in to comment.