Strip more whitespace from tag_object macro output.

master
voussoir 2020-09-14 05:17:44 -07:00
parent 54add8ad61
commit 5461d49cb4
1 changed files with 8 additions and 8 deletions

View File

@ -15,7 +15,7 @@
with_alt_description: with_alt_description:
True: Include the description in the alt text True: Include the description in the alt text
--> -->
{% macro tag_object( {%- macro tag_object(
tag, tag,
extra_classes="", extra_classes="",
innertext=None, innertext=None,
@ -24,7 +24,7 @@
with_alt_description=False with_alt_description=False
) -%} ) -%}
{% set href = { {%- set href = {
"search": "/search?tag_musts=" + tag.name, "search": "/search?tag_musts=" + tag.name,
"search_musts": "/search?tag_musts=" + tag.name, "search_musts": "/search?tag_musts=" + tag.name,
"search_mays": "/search?tag_mays=" + tag.name, "search_mays": "/search?tag_mays=" + tag.name,
@ -32,12 +32,12 @@
"info": "/tag/" + tag.name, "info": "/tag/" + tag.name,
None: None, None: None,
}.get(link, link) }.get(link, link)
%} -%}
{% set class = ("tag_object" + " " + extra_classes).strip() %} {%- set class = ("tag_object" + " " + extra_classes).strip() -%}
{% set title = (with_alt_description and tag.description) or None %} {%- set title = (with_alt_description and tag.description) or None -%}
{% set innertext = innertext or tag.name %} {%- set innertext = innertext or tag.name -%}
{% set element = "a" if (link or onclick) else "span" %} {%- set element = "a" if (link or onclick) else "span" -%}
<{{element}} {{make_attributes(class=class, title=title, href=href, onclick=onclick)|safe}}>{{innertext}}</{{element}}> <{{element}} {{make_attributes(class=class, title=title, href=href, onclick=onclick)|safe}}>{{innertext}}</{{element}}>
{{-''-}} {{-''-}}
{% endmacro %} {%- endmacro -%}