normalize comment text and author names

This commit is contained in:
Hamid Reza Mohammadi 2021-02-12 09:16:19 +03:30
parent d031504128
commit c35f6ffa5b

View File

@ -493,6 +493,8 @@ namespace RMuseum.Services.Implementation
foreach(GanjoorCommentSummaryViewModel comment in allComments)
{
comment.AuthorName = comment.AuthorName.ToPersianNumbers().ApplyCorrectYeKe();
comment.HtmlComment = comment.HtmlComment.ToPersianNumbers().ApplyCorrectYeKe();
comment.HtmlComment = _Linkify(comment.HtmlComment);
comment.HtmlComment = $"<p>{comment.HtmlComment.Replace("\r\n", "\n").Replace("\n\n", "\n").Replace("\n", "<br />".Replace("ي", "ی"))}</p>";
}
@ -567,6 +569,8 @@ namespace RMuseum.Services.Implementation
foreach (GanjoorCommentFullViewModel comment in paginatedResult.Items)
{
comment.AuthorName = comment.AuthorName.ToPersianNumbers().ApplyCorrectYeKe();
comment.HtmlComment = comment.HtmlComment.ToPersianNumbers().ApplyCorrectYeKe();
comment.HtmlComment = _Linkify(comment.HtmlComment);
comment.HtmlComment = $"<p>{comment.HtmlComment.Replace("\r\n", "\n").Replace("\n\n", "\n").Replace("\n", "<br />".Replace("ي", "ی"))}</p>";
}