Ticket #831 (closed defect: fixed)
Anchors are eaten by function checkEmpty
| Reported by: | guest | Owned by: | gogo |
|---|---|---|---|
| Priority: | normal | Milestone: | Version 1.0 |
| Component: | Xinha Core | Version: | trunk |
| Severity: | normal | Keywords: | bug, links, cleanup |
| Cc: |
Description
The following line in function checkEmpty(el) eats anchors on a page during a cleanup operation:
if ( /^(a|span|b|strong|i|em|font)$/i.test(el.tagName) && !el.firstChild)
{
HTMLArea.removeFromParent(el);
++stats.empty_tags;
}
The problem is the a in the list of tags to remove. Anchors are by definition empty tags, but they shouldn't be removed from a page during cleanup because this will break links. Removing the a in the above list solves the problem. While we're here, why not add empty div, span and p tags to this list?
Change History
Note: See
TracTickets for help on using
tickets.
