Skip to content Skip to sidebar Skip to footer

How To Remove Spaces In Twig

What i need i need to remove the spaces from html . i need like -- data---- extra spaces are removed by to remove extra spaces between html elements

Solution 1:

As stated in the documentation that you provided you need to wrap your ---code---- into some variable and then output it with removing spaces.

But I think that you already have your data in some variable and so your code should look like that:

{% spaceless %}
<imgclass="featurebanner lazy"data-src="http://10times.com/pics/event/1742/header_small_v47139.jpg"src="http://im.gifbt.com/images/event-images-default.jpg"alt=""><h3><ahref="intersec">
{{- intersec -}}
   </a></h3></div><divclass="evt_date"><span>18-20 Jan  </span>&bull; Dubai, UA
{% endspaceless %}

Post a Comment for "How To Remove Spaces In Twig"