add get_text template filter

returns object's `content` or `name`, the first is set, or an empty 
string.

some objects don't have `content`, don't let templates rely on it
This commit is contained in:
Fabio
2020-01-07 17:39:17 +01:00
parent a71bf46af5
commit 1f2a8f6da7
3 changed files with 12 additions and 4 deletions

View File

@@ -198,7 +198,7 @@
{% else %}
{{ obj.content | update_inline_imgs | clean | replace_custom_emojis(obj) | code_highlight | safe }}
{{ obj | get_text | update_inline_imgs | clean | replace_custom_emojis(obj) | code_highlight | safe }}
{% endif %}
{% if obj | has_place %}