alternate between <a> and <span> depending on instance_link
{% if stylesheet_url %}{% addtoblock "css" %}<link href="{{ stylesheet_url }}" rel="stylesheet" type="text/css" />{% endaddtoblock %}{% endif %}
{% spaceless %}
{% with instance_link=instance.link tag_type=instance.tag_type css_classes=instance.css_classes inline_styles=instance.inline_styles %}
-{% if instance_link %}<a href="{{ instance_link }}" {{ link_html_tag_attributes }}>{% endif %}
- {% if css_classes or inline_styles %}<span class="{{ css_classes }}" style="{{ inline_styles }}">{% endif %}
+{% if instance_link %}
+<a href="{{ instance_link }}" {{ link_html_tag_attributes }}{% if css_classes %} class="{{ css_classes }}"{% endif %}{% if inline_styles %} style="{{ inline_styles }}"{% endif %}>
+{% elif css_classes or inline_styles %}
+<span {% if css_classes %} class="{{ css_classes }}"{% endif %}{% if inline_styles %} style="{{ inline_styles }}"{% endif %}>
+{% endif %}
<i {{ icon_font_attrs }}></i>
- {% if css_classes or inline_styles %}</span>{% endif %}
-{% if instance_link %}</a>{% endif %}
+{% if instance_link %}</a>{% elif css_classes or inline_styles %}</span>{% endif %}
{% endwith %}
{% endspaceless %}
\ No newline at end of file
