Normalize newlines in comments and contents (fixes #380)

This commit is contained in:
Matt Nadareski
2022-04-04 21:12:50 -07:00
parent 426ceff451
commit 0efd82bd59
2 changed files with 7 additions and 0 deletions

View File

@@ -34,6 +34,7 @@
- Clear out fully matched IDs from the partial list
- Refine copy protection section showing
- Update Nuget packages
- Normalize newlines in comments and contents
### 2.3 (2022-02-05)
- Start overhauling Redump information pulling, again

View File

@@ -894,6 +894,9 @@ namespace MPF.Library
.Where(s => !string.IsNullOrEmpty(s))
) + "\n" + info.CommonDiscInfo.Comments;
// Normalize newlines
info.CommonDiscInfo.Comments = info.CommonDiscInfo.Comments.Replace("\r\n", "\n");
// Trim the comments field
info.CommonDiscInfo.Comments = info.CommonDiscInfo.Comments.Trim();
@@ -916,6 +919,9 @@ namespace MPF.Library
.Where(s => !string.IsNullOrEmpty(s))
) + "\n" + info.CommonDiscInfo.Contents;
// Normalize newlines
info.CommonDiscInfo.Contents = info.CommonDiscInfo.Contents.Replace("\r\n", "\n");
// Trim the contents field
info.CommonDiscInfo.Contents = info.CommonDiscInfo.Contents.Trim();