Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better SplitLongLinesInSubtitle #3370

Merged
merged 3 commits into from Feb 22, 2019
Merged

Better SplitLongLinesInSubtitle #3370

merged 3 commits into from Feb 22, 2019

Conversation

ivandrofly
Copy link
Member

No description provided.

spacing2++;
}

double duration = p.Duration.TotalMilliseconds / 2.0;
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is really wrong, we can't assume both line with have same amount of characters... this problem is handle in this PR.

Correct one should be:
d1 = (td / at) * (l1 - nl)

  • d1: duration for paragraph one
  • td: total duration
  • at: all text
  • l1: length of firstline
  • nl: Environment.NewLine.Length

Cleaner and easy to read/understand

@ivandrofly ivandrofly marked this pull request as ready for review February 15, 2019 19:59
{
return false;
}
string textNoTags = HtmlUtil.RemoveHtmlTags(text);
Copy link
Member Author

Choose a reason for hiding this comment

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

Handles if text ends with any of the supported html tags

@niksedk
Copy link
Member

niksedk commented Feb 16, 2019

It would be really nice if you could add some unit tests :)

@ivandrofly
Copy link
Member Author

It would be really nice if you could add some unit tests :)

Done ✅

@niksedk niksedk merged commit a4f14cd into SubtitleEdit:master Feb 22, 2019
@ivandrofly ivandrofly deleted the spl branch February 22, 2019 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants