pass the correct element when trapping links
Merge pull request #228 from niphlod/enhancement/trapped_links

pass the correct element when trapping links