Reputation: 12534
I have seen this question up here and some are solving it by comment tags or breaking tags like this:
<i><!--
-->t does not work on the first level with tabspace = 2
beside it looks horrible.
<a
>nnoying<
/a> is it not?
I remember as if I have seen some trick like
<a>&dont_put_here_space_please;
tricky ampersand code.
Is there any such thing?
I am using now jinja2 python template engine. Does it have some space-preventing trick?
UPDATE:
With jinja2, thanks to dav1d, the shortest way I could come up with is:
<a>{% if true -%}
No space in the output before this text.
</a>{% endif -%}
Nor after.
Is there any shorter way of doing this?
Upvotes: 19
Views: 33365
Reputation: 29
I know this is an old question but I'd like to share how I got it to work around in my code: Using span.
<span> .../line1... /line2 ... </span>
Upvotes: 0
Reputation: 6055
Jinja2 WhiteSpace Control is what you need (according to your reponse to my comment): http://jinja.pocoo.org/docs/templates/#whitespace-control
Upvotes: 15