diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-12-07 13:40:44 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-12-07 13:40:44 -0500 |
commit | a78b1935928919694dfe8de823a1accd6d222732 (patch) | |
tree | 3f17b6087cf2749e52c1e237de17e2e9addb6c06 /src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs | |
parent | 4cd9eda1591c3908bf80b60c2902491a7595ee27 (diff) | |
parent | 8901218418693d610a17b22fe789ba6279f63446 (diff) | |
download | SMAPI-a78b1935928919694dfe8de823a1accd6d222732.tar.gz SMAPI-a78b1935928919694dfe8de823a1accd6d222732.tar.bz2 SMAPI-a78b1935928919694dfe8de823a1accd6d222732.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs')
-rw-r--r-- | src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs index 106c294f..61d0d6f2 100644 --- a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -90,6 +90,14 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning } } + // normalise display fields + if (manifest != null) + { + manifest.Name = this.StripNewlines(manifest.Name); + manifest.Description = this.StripNewlines(manifest.Description); + manifest.Author = this.StripNewlines(manifest.Author); + } + return new ModFolder(root, manifestFile.Directory, manifest, manifestError); } @@ -164,5 +172,12 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning { return !this.IgnoreFilesystemEntries.Contains(entry.Name); } + + /// <summary>Strip newlines from a string.</summary> + /// <param name="input">The input to strip.</param> + private string StripNewlines(string input) + { + return input?.Replace("\r", "").Replace("\n", ""); + } } } |