mirror of https://github.com/odrling/Aegisub
Fix #809, properly close all SRT overrides during export and ensure overrides in recombined lines do not affect each other (per the example I gave in the report.)
Originally committed to SVN as r2934.
This commit is contained in:
parent
44e17e9e11
commit
988df0ab81
|
@ -671,6 +671,16 @@ void AssDialogue::ConvertTagsToSRT () {
|
|||
}
|
||||
}
|
||||
|
||||
// Ensure all tags are closed
|
||||
if (isBold)
|
||||
final += _T("</b>");
|
||||
if (isItalic)
|
||||
final += _T("</i>");
|
||||
if (isUnder)
|
||||
final += _T("</u>");
|
||||
if (isStrike)
|
||||
final += _T("</s>");
|
||||
|
||||
Text = final;
|
||||
UpdateData();
|
||||
ClearBlocks();
|
||||
|
|
|
@ -184,9 +184,15 @@ void SRTSubtitleFormat::WriteFile(wxString _filename,wxString encoding) {
|
|||
CreateCopy();
|
||||
SortLines();
|
||||
StripComments();
|
||||
// Tags must be converted in two passes
|
||||
// First ASS style overrides are converted to SRT but linebreaks are kept
|
||||
ConvertTags(2,_T("\\N"));
|
||||
// Then we can recombine overlaps, this requires ASS style linebreaks
|
||||
RecombineOverlaps();
|
||||
MergeIdentical();
|
||||
ConvertTags(2,_T("\r\n"));
|
||||
// And finally convert linebreaks
|
||||
ConvertTags(0,_T("\r\n"));
|
||||
// Otherwise unclosed overrides might affect lines they shouldn't, see bug #809 for example
|
||||
|
||||
// Write lines
|
||||
int i=1;
|
||||
|
|
Loading…
Reference in New Issue