The various link_artist, link_area, link_editor etc. macros mostly do the same thing, but each has its own code. The common parts should be factored out.
In addition, duplicate conditions such as
'<span class="name-variation">' IF text != '' AND text != artist.name AND action == 'show';
'</span>' IF text != '' AND text != artist.name AND action == 'show';
are prone to errors (MBS-7684) and should be combined, too.