From 3b6417eff2eb359129a6472bca2f54da4704d43b Mon Sep 17 00:00:00 2001 From: Glax Date: Wed, 31 Jul 2024 17:48:05 +0200 Subject: [PATCH] Fix #214 HTML encoded Characters --- Tranga/Manga.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Tranga/Manga.cs b/Tranga/Manga.cs index 171daad..eb9e5d8 100644 --- a/Tranga/Manga.cs +++ b/Tranga/Manga.cs @@ -1,6 +1,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; +using System.Web; using Newtonsoft.Json; using static System.IO.UnixFileMode; @@ -51,11 +52,11 @@ public struct Manga [JsonConstructor] public Manga(string sortName, List authors, string? description, Dictionary altTitles, string[] tags, string? coverUrl, string? coverFileNameInCache, Dictionary? links, int? year, string? originalLanguage, string publicationId, ReleaseStatusByte releaseStatus, string? websiteUrl = null, string? folderName = null, float? ignoreChaptersBelow = 0) { - this.sortName = sortName; - this.authors = authors; - this.description = description; - this.altTitles = altTitles; - this.tags = tags; + this.sortName = HttpUtility.HtmlDecode(sortName); + this.authors = authors.Select(HttpUtility.HtmlDecode).ToList()!; + this.description = HttpUtility.HtmlDecode(description); + this.altTitles = altTitles.ToDictionary(a => HttpUtility.HtmlDecode(a.Key), a => HttpUtility.HtmlDecode(a.Value)); + this.tags = tags.Select(HttpUtility.HtmlDecode).ToArray()!; this.coverFileNameInCache = coverFileNameInCache; this.coverUrl = coverUrl; this.links = links ?? new Dictionary();