This commit is contained in:
Hamid Reza Mohammadi 2025-03-24 11:58:46 +03:30
parent d345dac18b
commit def19f06b4
3 changed files with 19 additions and 3 deletions

View File

@ -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<IActionResult> OnPostSendCorrectionsModerationAsync([FromBody] PoemMoerationStructure pms)
{
using (HttpClient secureClient = new HttpClient())

View File

@ -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)
{

View File

@ -47,7 +47,14 @@ namespace RMuseum.Utils
string textWithoutTags = Regex.Replace(input, "<.*?>", string.Empty);
// Decode HTML entities (e.g., &amp; → &)
return HttpUtility.HtmlDecode(textWithoutTags);
textWithoutTags = HttpUtility.HtmlDecode(textWithoutTags);
//it seems some codes are not correctly converted:
textWithoutTags = textWithoutTags.Replace("&zwnj;", "‌");
textWithoutTags = textWithoutTags.Replace("&laquo;", "»");
textWithoutTags = textWithoutTags.Replace("&raquo;", "«");
return textWithoutTags;
}
}
}