Use [%- and -%] instead

This commit only changes [% and %] to [%- and -%].
Simplify entity_exists macro