ArthurHub / ArthurHub/HTML-Renderer

Super slow performance when there are lots of "a" html tags

Open
#239 2 comments 0 reactions 0 assignees View on GitHub
bug HTML
Dominant language
C#
Stars
1.4k
Forks
550
Avg merge
14d 9h
Merged PRs (30d)
1

Description

I am displaying an HTML, having about 200 **a** tags, the initial load and display of html is super slow.

When I modify **IsBlockAssignableToBox** function, so it does not add **a** tags, the performance issue is resolved ( and offcourse a tags are not rendered as links)

modifed **IsBlockAssignableToBox** version :

```
private static bool IsBlockAssignableToBox(CssBox box, CssBlock block)
{
bool assignable = true;
if (block.Selectors != null)
{
assignable = IsBlockAssignableToBoxWithSelector(box, block);
}
else if (box.HtmlTag.Name.Equals("a", StringComparison.OrdinalIgnoreCase) && block.Class.Equals("a", StringComparison.OrdinalIgnoreCase)
// && !box.HtmlTag.HasAttribute("href")
)
{
assignable = false;
}

if (assignable && block.Hover)
{
box.HtmlContainer.AddHoverBox(box, block);
assignable = false;
}

return assignable;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.