Заготовка опросов
This commit is contained in:
@@ -190,7 +190,7 @@ public sealed class TelegramHtmlParser : ITelegramHtmlParser
|
||||
string fileName = "";
|
||||
var titleNode = link.QuerySelector(".title") ?? link.QuerySelector(".name") ?? link.QuerySelector(".description");
|
||||
|
||||
if (titleNode != null)
|
||||
if (titleNode != null && !titleNode.TextContent.Contains(":") && titleNode.TextContent.Length < 100)
|
||||
{
|
||||
fileName = titleNode.TextContent.Trim();
|
||||
}
|
||||
@@ -202,7 +202,8 @@ public sealed class TelegramHtmlParser : ITelegramHtmlParser
|
||||
{
|
||||
var clone = (IElement)bodyNode.Clone();
|
||||
foreach (var s in clone.QuerySelectorAll(".status, .details, .pull_right")) s.Remove();
|
||||
fileName = clone.TextContent.Trim();
|
||||
var candidate = clone.TextContent.Trim();
|
||||
if (candidate.Length > 0 && candidate.Length < 100 && !candidate.Contains(":")) fileName = candidate;
|
||||
}
|
||||
|
||||
// Final desperate attempt: link's own content excluding status tags
|
||||
@@ -210,7 +211,8 @@ public sealed class TelegramHtmlParser : ITelegramHtmlParser
|
||||
{
|
||||
var clone = (IElement)link.Clone();
|
||||
foreach (var s in clone.QuerySelectorAll(".status, .details, .pull_right, .details_icon")) s.Remove();
|
||||
fileName = clone.TextContent.Trim();
|
||||
var candidate = clone.TextContent.Trim();
|
||||
if (candidate.Length > 0 && candidate.Length < 100 && !candidate.Contains(":")) fileName = candidate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user