From 30715d5c26e0dd9db1fc0cba97706bd80fdddd9b Mon Sep 17 00:00:00 2001 From: Patrick Hetz Date: Thu, 18 Apr 2024 06:50:10 -0400 Subject: [PATCH] Add fix for unclosed HTML breaks This changes the order of operations, truncating description before replacing newlines with HTML breaks, to prevent the creation of unclosed breaks which may otherwise cause rendering issues in Jellyfin. --- Jellyfin.Plugin.TubeArchivistMetadata/Utils/Utils.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Plugin.TubeArchivistMetadata/Utils/Utils.cs b/Jellyfin.Plugin.TubeArchivistMetadata/Utils/Utils.cs index b9f5d26..f2849a5 100644 --- a/Jellyfin.Plugin.TubeArchivistMetadata/Utils/Utils.cs +++ b/Jellyfin.Plugin.TubeArchivistMetadata/Utils/Utils.cs @@ -47,7 +47,8 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities if (description.Length > maxLength) { - description = description.Replace("\n", "
", System.StringComparison.CurrentCulture).Substring(0, maxLength); + description = description.Substring(0, maxLength); + description = description.Replace("\n", "
", System.StringComparison.CurrentCulture); } return description;