From 0efd82bd59032104b061e54461dcf09b5aba5b6a Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 4 Apr 2022 21:12:50 -0700 Subject: [PATCH] Normalize newlines in comments and contents (fixes #380) --- CHANGELIST.md | 1 + MPF.Library/InfoTool.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELIST.md b/CHANGELIST.md index e3c2e846..b276587e 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -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 diff --git a/MPF.Library/InfoTool.cs b/MPF.Library/InfoTool.cs index 7ec2ef8c..81d4cdfe 100644 --- a/MPF.Library/InfoTool.cs +++ b/MPF.Library/InfoTool.cs @@ -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();