settings for comments text processing
This commit is contained in:
parent
45f639f003
commit
3d541249fe
@ -1026,8 +1026,10 @@ namespace RMuseum.Services.Implementation
|
||||
|
||||
content = await _ProcessCommentHtml(content, _context);
|
||||
|
||||
int maxWordLengthInComments = int.Parse(Configuration.GetSection("Ganjoor")["MaxWordLengthInComments"]);
|
||||
|
||||
string commentText = Regex.Replace(content, "<.*?>", string.Empty);
|
||||
if (commentText.Split(" ", StringSplitOptions.RemoveEmptyEntries).Max(s => s.Length) > 50)
|
||||
if (commentText.Split(" ", StringSplitOptions.RemoveEmptyEntries).Max(s => s.Length) > maxWordLengthInComments)
|
||||
{
|
||||
return new RServiceResult<GanjoorCommentSummaryViewModel>(null, "متن حاشیه شامل کلمات به هم پیوستهٔ طولانی است.");
|
||||
}
|
||||
|
||||
@ -66,7 +66,8 @@
|
||||
"BooksCoverTemplate": "C:\\inetpub\\epub\\res\\cover-image.png",
|
||||
"BooksCoverTitleFontName": "IranNastaliq",
|
||||
"BooksCoverTitleFontSize": "40",
|
||||
"ImportCommentsAsPoemSummary": "True"
|
||||
"ImportCommentsAsPoemSummary": "True",
|
||||
"MaxWordLengthInComments": 200
|
||||
},
|
||||
"ExternalFTPServer": {
|
||||
"Host": "localhost",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user