mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
Fixes for new JSON Aeneas - thx Cedric :)
This commit is contained in:
parent
027328ea05
commit
e3ea68ed11
@ -15,7 +15,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
public override string ToText(Subtitle subtitle, string title)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("{ \"fragments\": [");
|
||||
sb.AppendLine("{" + Environment.NewLine + " \"fragments\": [");
|
||||
|
||||
for (int i = 0; i < subtitle.Paragraphs.Count; i++)
|
||||
{
|
||||
@ -33,9 +33,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
},");
|
||||
}
|
||||
|
||||
var result = sb.ToString().TrimEnd(',') + @" ]
|
||||
}";
|
||||
|
||||
var result = sb.ToString().Trim().TrimEnd(',') + Environment.NewLine + " ]" + Environment.NewLine + "}";
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -44,10 +42,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var sb = new StringBuilder();
|
||||
foreach (var line in text.SplitToLines())
|
||||
{
|
||||
sb.Append("\" " + Json.EncodeJsonText(line) + " \",");
|
||||
sb.Append("\"" + Json.EncodeJsonText(line) + "\", ");
|
||||
}
|
||||
|
||||
return sb.ToString().TrimEnd(',');
|
||||
return sb.ToString().Trim().TrimEnd(',');
|
||||
}
|
||||
|
||||
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
|
||||
|
Loading…
Reference in New Issue
Block a user