Add support for wrapper elements

Adapts markturner's pull request to support any element (rather than just list elements) for wrapping the links.