strip newlines in manifest display fields
This commit is contained in:
parent
d1fb273d20
commit
43f11cfe51
|
@ -3,6 +3,9 @@
|
|||
* For players:
|
||||
* Fixed cryptic error when running the installer from inside a zip file on Windows.
|
||||
|
||||
* For modders:
|
||||
* Fixed newlines in most manifest fields not being ignored.
|
||||
|
||||
* For the web UI:
|
||||
* Added stats to compatibility list.
|
||||
* Fixed compatibility list showing beta header when there's no beta in progress.
|
||||
|
|
|
@ -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", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue