fix links enabling

In link enabling code `toRemove` and `toPush` objects were created inside a loop that iterates over attributes. They should be created in a level above, in a loop that iterates over elements. This caused two issues:

1) only last attribute was enabled (that was not a problem because usually there is only one such attribute);
2) toRemove and toPush objects were not cleaned for elements without attributes - this causes unrelated elements (e.g. a `<span>` tag inside `<a href="...">` tag) to get href attributes from the previous elements.