From be33db83396557dc6ef075c813e7b7d0ba44a394 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 16 Apr 2022 12:15:23 -0700 Subject: [PATCH] Sanitize whitespace around tabs --- CHANGELIST.md | 1 + MPF.Library/InfoTool.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELIST.md b/CHANGELIST.md index 13ff2276..f284c0a4 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -60,6 +60,7 @@ - Convert triple space to tab - Fix clone issue with copy protection - Be more picky about multisession +- Sanitize whitespace around tabs ### 2.3 (2022-02-05) - Start overhauling Redump information pulling, again diff --git a/MPF.Library/InfoTool.cs b/MPF.Library/InfoTool.cs index bd5c6ae8..ac327adb 100644 --- a/MPF.Library/InfoTool.cs +++ b/MPF.Library/InfoTool.cs @@ -1064,6 +1064,9 @@ namespace MPF.Library value = value.Replace("", "\t"); value = value.Replace(" ", "\t"); + // Sanitize whitespace around tabs + value = Regex.Replace(value, @"\s*\t\s*", @"\t"); + // If the value contains a newline value = value.Replace("\r\n", "\n"); if (value.Contains("\n"))