diff --git a/GanjooRazor/Areas/Admin/Pages/ReviewCatEdits.cshtml.cs b/GanjooRazor/Areas/Admin/Pages/ReviewCatEdits.cshtml.cs index f97d3527..f4d5c495 100644 --- a/GanjooRazor/Areas/Admin/Pages/ReviewCatEdits.cshtml.cs +++ b/GanjooRazor/Areas/Admin/Pages/ReviewCatEdits.cshtml.cs @@ -12,7 +12,6 @@ using RMuseum.Models.Ganjoor; using static GanjooRazor.Areas.Admin.Pages.ReviewEditsModel; using System.Text; using System; -using Org.BouncyCastle.Asn1.Cmp; namespace GanjooRazor.Areas.Admin.Pages { @@ -95,6 +94,16 @@ namespace GanjooRazor.Areas.Admin.Pages return Page(); } + public IActionResult OnPost() + { + Skip = string.IsNullOrEmpty(Request.Query["skip"]) ? 0 : int.Parse(Request.Query["skip"]); + if (Request.Form["next"].Count == 1) + { + return Redirect($"/Admin/ReviewCatEdits/?skip={Skip + 1}"); + } + return Page(); + } + public async Task OnPostSendCorrectionsModerationAsync([FromBody] PoemMoerationStructure pms) { using (HttpClient secureClient = new HttpClient()) diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateCatCorrection.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateCatCorrection.cs index f1936b5d..53cbb4c7 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateCatCorrection.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-ModerateCatCorrection.cs @@ -76,7 +76,7 @@ namespace RMuseum.Services.Implementation dbCorrection.AffectedTheCat = true; dbCat.DescriptionHtml = moderation.DescriptionHtml.Replace("ۀ", "هٔ").Replace("ك", "ک"); - dbCat.Description = Regex.Replace(dbCat.DescriptionHtml, "<.*?>", String.Empty); + dbCat.Description = moderation.Description; if(dbCat.ParentId == null) { diff --git a/RMuseum/Utils/GanjoorPoemTools.cs b/RMuseum/Utils/GanjoorPoemTools.cs index a1f5bd9b..b89282da 100644 --- a/RMuseum/Utils/GanjoorPoemTools.cs +++ b/RMuseum/Utils/GanjoorPoemTools.cs @@ -47,7 +47,14 @@ namespace RMuseum.Utils string textWithoutTags = Regex.Replace(input, "<.*?>", string.Empty); // Decode HTML entities (e.g., & → &) - return HttpUtility.HtmlDecode(textWithoutTags); + textWithoutTags = HttpUtility.HtmlDecode(textWithoutTags); + + //it seems some codes are not correctly converted: + textWithoutTags = textWithoutTags.Replace("‌", "‌"); + textWithoutTags = textWithoutTags.Replace("«", "»"); + textWithoutTags = textWithoutTags.Replace("»", "«"); + + return textWithoutTags; } } }