ArthurHub / ArthurHub/HTML-Renderer

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

Aperta
#239 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug HTML
Lingua principale
C#
Stelle
1.4k
Fork
550
Merge medio
14g 9h
PR unite (30g)
1

Descrizione

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;
}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.