title: Spaceless is not working for removing whole html data spaces
body: <p>what i need</p>
  
  <ul>
  <li>i need to remove space between html elements.</li>
  </ul>
  
  <p>twig code</p>
  
  <pre><code>    {% spaceless %}
  
              &lt;head&gt;
  
              {% block title %}
              &lt;title&gt;times&lt;/title&gt;
              &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
              &lt;meta name="description" content="" /&gt;
              &lt;meta name="keywords" content="" /&gt;
              {% endblock %}  
              &lt;meta property="fb:admins" content="10timesevents" /&gt;
              &lt;meta property="fb:app_id" content="432858816746099" /&gt;
  
              {% block css %}
  
              &lt;noscript&gt;
              &lt;link rel="stylesheet" href="http://im.gifbt.com/css/skel-noscript.css" /&gt;
  
              &lt;link rel="stylesheet" href="http://im.gifbt.com/css/style9.css" type="text/css" &gt;
  
              {% if DeviceDetcet() =='computer' %}
              &lt;link rel="stylesheet" href="http://im.gifbt.com/css/style9-desktop.css" type="text/css  /&gt;
  
              {% elseif DeviceDetcet() =='tablet' %}
  
              &lt;link rel="stylesheet" href="http://im.gifbt.com/css/style9-1000px.css" type="text/css  /&gt;
  
              {% elseif DeviceDetcet() =='phone' %}
              &lt;link rel="stylesheet" href="http://im.gifbt.com/css/style9-mobile.css" type="text/css  /&gt;
  
              {%endif%}
              &lt;/noscript&gt; 
              {% endblock %}
  
              {% block scripts %}
              &lt;link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600' rel='stylesheet' type='text/css' /&gt;     
              &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt;
  
  
              {#      &lt;script src="http://im.gifbt.com/js/jquery.poptrox-2.2.js"&gt;&lt;/script&gt;#}
              &lt;script src="http://im.gifbt.com/js/skel.min.js"&gt;&lt;/script&gt;
  
  
  
  
              {% if DeviceDetcet()=='phone'%}
              &lt;script src="http://im.gifbt.com/js/skelnew-panels.min.js"&gt;&lt;/script&gt;
              {%endif%}
              &lt;script src="http://im.gifbt.com/js/common.10.min.js"&gt;&lt;/script&gt;
              &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
  
  
              {% endblock %}
  
  
  
              &lt;!--[if lte IE 8]&gt;&lt;script src="http://im.gifbt.com/js/html5shiv.js"&gt;&lt;/script&gt;&lt;link rel="stylesheet" href="http://im.gifbt.com/css/ie8.css" /&gt;&lt;![endif]--&gt;
  
              &lt;/head&gt;
              {% block body_tag %}
              &lt;body&gt;
              {% if  'android' in UserAgent() or 'Android' in UserAgent() %}
              &lt;div style="position:fixed; width:100%; z-index:9; right:0; left:0; bottom:0;"&gt;
              &lt;div class="row flush"&gt;
              &lt;div style="height:60px; background:#fb6d02; padding:14px 7px 7px 7px!important; border-bottom:1px solid #e16000; border-top:1px solid #e16000"&gt;
              &lt;img src="http://im.gifbt.com/images/android100.png"style="float:left; width:30px; padding:0 5px 0 0" /&gt;
              &lt;p style=" font-size:.9em; line-height:1.1em; margin:0; "&gt;
              &lt;a href="https://play.google.com/store/apps/details?id=com.tentimes&amp;referrer=utm_source%3Dsite%26utm_medium%3Dbottom-banner" target="_blank" style="float:right; font-size:1.1em; line-height:1.6em; text-decoration:none; color:#fff; background:#333335; padding:.3em .7em; margin-top:1px;"&gt;Download Now&lt;/a&gt;
              &lt;b class="bld" style="float:left; padding:7px 0 0 0; color:#fff"&gt;Stay updated with 10times App&lt;/b&gt;
              &lt;/p&gt;
              &lt;/div&gt;
              &lt;/div&gt; 
              &lt;/div&gt;
  
              {% endif %}
              &lt;span id="evtname"&gt;&lt;/span&gt;
  
              &lt;!-- Google Tag Manager --&gt;
              &lt;noscript&gt;&lt;iframe src="//www.googletagmanager.com/ns.html?id=GTM-MMVJS3" 
              height="0" width="0" style="display:none;visibility:hidden"&gt;&lt;/iframe&gt;&lt;/noscript&gt;
              &lt;script&gt;(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
              new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
              j=d.createElement(s),dl=l!='dataLayer'?'&amp;l='+l:'';j.async=true;j.src=
              '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
              })(window,document,'script','dataLayer','GTM-MMVJS3');&lt;/script&gt;
              &lt;!-- End Google Tag Manager --&gt; 
              {% endblock %}
              &lt;!-- Header Wrapper --&gt;
              {% block homepage_head %}
              {#Fixed navbar#}
              &lt;div class="navbar navbar-static navbar-default navbar-fixed-top" style="margin:0; min-height:38px; offsetheight:38px!important"&gt;
              &lt;div class="not-mobile" style="background:#fff"&gt;
              &lt;div class="new_header"&gt;
              &lt;div class="headerdiv"&gt;
              &lt;div class="l"&gt;
              &lt;ul class="navigation"&gt;
              &lt;li&gt;&lt;a href="{{ DomainDetect()}}/tradeshows"&gt;Trade Shows&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{{ DomainDetect()}}/conferences"&gt;Conferences&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{{ DomainDetect()}}/top100"&gt;Top 100&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="{{ DomainDetect()}}/venues"&gt;Venues&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
              &lt;/div&gt;
              &lt;div class="c"&gt;
              &lt;a href="http://10times.com" class="newlogo" &gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="r"&gt;
              &lt;div class="user-nav"&gt;
              &lt;div id="header-login-dd-link"&gt;&amp;nbsp;
              &lt;div class="user-dropdown dis-non"&gt;
              &lt;ul class="udr"&gt;
  
              &lt;li&gt;&lt;a class="manage udbr" href="http://{{-login_url}}"&gt;Manage Event&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a class="contact udbr" onclick="feed_back();"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a class="signin udbr" onclick = "signin();"&gt;Sign In&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a class='dashboard udbr' href='http://{{-login_url}}/dashboard'&gt;My Dashboard&lt;/a&gt;&lt;/li&gt;
  
  
              &lt;/ul&gt;
              &lt;/div&gt;
              &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="screen-block" style="display: none;"&gt;&lt;/div&gt;
  
              &lt;a class="advt" href="{{ DomainDetect()}}/services"&gt;Advertise&lt;/a&gt;
              &lt;a href="{{ DomainDetect()}}/addevent" class="adevnt"&gt;Add Event&lt;/a&gt;
              &lt;div class="searchdiv"&gt;
              &lt;span style="margin-top:10px" class="srhbx 4u" id="srh"&gt;&lt;input type="button" value=" " class="srhbtn" onclick="checkHeaderSearch($(this));" id="explore-button" style="float:right" /&gt;&lt;div id="search-box-area" class="p-relative search-box-area zind"&gt;&lt;input type="text" name="" autocomplete="off" id ="explore-keywords" placeholder="search" 
              class="srhtxt homesearch" style="width:75%" required /&gt;&lt;div id="explore-keywords-dropdown" autocorrect="off" &gt;&lt;div id="keywords-dd" class="kkdd"&gt;&lt;ul id="keywords-by" style="margin:0;"&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;
              &lt;/div&gt; 
              &lt;/div&gt;
              {#&lt;div class="searchdiv"&gt;
              &lt;form action="{{ DomainDetect()}}/search" method="get" id="srh"&gt;
              &lt;div class="srhbx" id="search-box-area "&gt;
              &lt;input type="text" class="srhtxt homesearch" autocomplete="off" id ="explore-keywords" placeholder="Search" name="q" {% if DeviceDetcet()=='computer'%} style="width:75%" {%endif%}  required=""&gt;
              &lt;input type="submit" value="&amp;nbsp;" class="srhbtn" required="" &gt;
              &lt;div id="explore-keywords-dropdown"  autocorrect="off" &gt;
              &lt;div id="keywords-dd" class="kkdd"&gt;
              &lt;ul id="keywords-by" style="margin:0;"&gt;&lt;/ul&gt;
              &lt;/div&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;/form&gt;
              &lt;/div&gt;  
              &lt;/div&gt;#}
              &lt;/div&gt;
              &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div class="only-mobile"&gt;
              &lt;div class="new_header"&gt;
              &lt;div id="hide-header" class="headerdiv"&gt;
              &lt;div class="l"&gt;
  
  
              &lt;button type="button" class="navbar-toggle toggle-left" data-toggle="sidebar" data-target=".sidebar-left" style="margin:4px 0 0 5px; border:0; padding:8px"&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;/button&gt;
  
              &lt;/div&gt;
              &lt;div class="c"&gt;
              &lt;a href="/" class="newlogo"&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="r"&gt;
              &lt;div class="mobile_menu"&gt;
              &lt;a onclick="change();" class="srhbtn"&gt;&amp;nbsp;&amp;nbsp;&lt;/a&gt;
              &lt;/div&gt;
              &lt;/div&gt;
              &lt;/div&gt;
              &lt;div id="search-field" class="headerdiv dis-non" style="display: none;"&gt;
              &lt;form method="get" action="http://10times.com/search" id="srh" class="mr"&gt;
              &lt;div class="ll"&gt;
  
              &lt;button type="button" class="navbar-toggle toggle-left" data-toggle="sidebar" data-target=".sidebar-left" style="margin:4px 0 0 5px; border:0; padding:8px"&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;/button&gt;
              &lt;/div&gt;
              &lt;div id="search-field" class="cc"&gt;
              &lt;input type="hidden" name="cx" value="partner-pub-8525015516580200:vtujn0s4zis"&gt;
              &lt;input type="hidden" name="cof" value="FORid:10"&gt;
              &lt;input type="hidden" name="ie" value="ISO-8859-1"&gt;
              &lt;input type="text" name="q"  id ="q"    placeholder="Search..."    class="srhtxt1" required /&gt;
  
              &lt;/div&gt;
              &lt;div class="rr"&gt;
              &lt;input type="submit" value="&amp;nbsp;" class="srhbtn1"&gt;
              &lt;/div&gt;
              &lt;/form&gt;
              &lt;/div&gt;
              &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;/div&gt;{#endo of new main col-md-12#}
              &lt;div class="col-xs-7  col-md-3 sidebar sidebar-left sidebar-animate" style="background:#212628; padding:0; top:39px; position:fixed!important"&gt;
  
  
              &lt;div id="sidebar-wrapper" class="only-mobile"&gt;
              &lt;ul class="sidebar-nav" style="margin:0; padding:0;"&gt;
              &lt;li class="only-mobile"&gt;&lt;a href="{{ DomainDetect()}}" class="hm"&gt;Home&lt;/a&gt;&lt;/li&gt;
              &lt;li class="only-mobile"&gt;&lt;a href="{{ DomainDetect()}}/tradeshows" class="ts"&gt;Trade Shows&lt;/a&gt;&lt;/li&gt;
              &lt;li class="only-mobile"&gt;&lt;a href="{{ DomainDetect()}}/conferences" class="con"&gt;Conferences&lt;/a&gt;&lt;/li&gt;
              &lt;li class="only-mobile"&gt;&lt;a href="{{ DomainDetect()}}/top100" class="tp"&gt;Top 100&lt;/a&gt;&lt;/li&gt;
              &lt;li class="only-mobile"&gt;&lt;a href="{{ DomainDetect()}}/venues" class="vn"&gt;Venues&lt;/a&gt;&lt;/li&gt;
              &lt;li class="only-mobile"&gt;&lt;a href="http://{{-login_url}}/addevent" class="ae"&gt;Add Event&lt;/a&gt;&lt;/li&gt;
              &lt;li class="only-mobile"&gt;&lt;a href="{{ DomainDetect()}}/services" class="ad"&gt;Advertise&lt;/a&gt;&lt;/li&gt;
              &lt;li class="only-mobile"&gt;&lt;a href="http://login.10times.com" class="mng"&gt;Manage Event&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
              &lt;/div&gt;
  
              &lt;/div&gt;
  
              &lt;/div&gt;{#endo of row#}   
  
              &lt;/div&gt;
              {% block heightfromhead %}
              &lt;div style="height:51px" class="not-mobile"&gt;&amp;nbsp;&lt;/div&gt;
              &lt;div style="height:40px" class="only-mobile"&gt;&amp;nbsp;&lt;/div&gt;
              {% endblock %}
  
  
              &lt;!-- header end --&gt;
  
              {% endblock %}
              {# {% block search_head %}body goes here!{% endblock %}         #}
              {% block body %}body goes here!{% endblock %}
  
              &lt;!-- PAGE END --&gt;
  
              &lt;script type="text/javascript"&gt;
              function feed_back(){modal.open({content:'&lt;div class="12u skel-cell-mainContent"&gt;&lt;div class="box panel pd"&gt;&lt;image src="/img/lineloading.gif"&gt;&lt;/div&gt;&lt;/div&gt;'});$.get("/feedback",function(e){modal.open({content:e})})}
              &lt;/script&gt;
  
  
              &lt;script async src="http://im.gifbt.com/js/suggestive_search_2.js"&gt;&lt;/script&gt;
  
              {% block bottom_script %} 
              &lt;script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
  
              {% endblock %}
              {#          &lt;script type="text/javascript"&gt;#}
              {# $(document).ready(function(){#}
              {#  $("#searchpanel").removeClass('dis-non');   #}
              {# });#}
              {# &lt;/script&gt;#}
              &lt;/div&gt;
  
  
              {% if  'android' in UserAgent() or 'Android' in UserAgent() %}
              &lt;script&gt;
              $( document ).ready(function() {
              {% if cookie('get','10tphpopup') == '0'%}
              {{-cookie('get','10tphpopup')}}
              {{-cookie('set','10tphpopup',1,3600*24*365)}}
              //$("div").first().addClass('dis-non');
              var height=$( window ).height();
              //height=height-50;
              height=height+"px";
  
  
              {%endif%}
              });
              &lt;/script&gt;
  
              {%endif%}
              {% if  'iPhone' in UserAgent() or 'iphone' in UserAgent() %}
              &lt;script&gt;
              $( document ).ready(function() {
              {% if cookie('get','10tphpopup') == '0'%}
              {{-cookie('get','10tphpopup')}}
              {{-cookie('set','10tphpopup',1,3600*24*365)}}
              //$("div").first().addClass('dis-non');
              var height=$( window ).height();
              //height=height-50;
              height=height+"px";
  
  
  
              //modal.open({content:'&lt;div class="12u skel-cell-mainContent"&gt;&lt;div class="box panel pd"&gt;&lt;image src="/img/lineloading.gif"&gt;&lt;/div&gt;&lt;/div&gt;'});$.get("{{ DomainDetect()}}/android?type=iphone",function(e){modal.open({content:e})})
              {%endif%}
              });
  
              &lt;/script&gt;
  
              {%endif%}
  
              {% block bottom_script2 %} 
  
  
              {%endblock%}
              {% block bottom_script3 %} 
  
              {#&lt;link rel="stylesheet" type="text/css" href="{{ DomainDetect()}}/headersearch.css" /&gt;#}
  
  
              {%endblock%}
              {% if  'android' in UserAgent() or 'Android' in UserAgent() %}
              &lt;script type="text/javascript"&gt;
              if(sessionStorage.getItem("count1")=='NaN')
              {
              sessionStorage.setItem("count1", 0);
              counters = 0;
              }
              if(sessionStorage.getItem("count1") == null)
              {
              sessionStorage.setItem("count1", 0);
              counters = 0;
              }
              else
              {
              counters= parseInt(sessionStorage.getItem("count1"));
              //alert(sessionStorage.getItem("count1"));
              }
              if (page_count == 4)
              {
              dataLayer.push({'event':'mobilePromo-android'});
              }
  
              &lt;/script&gt;
  
              {% endif %}
              {%if 'iPhone' in UserAgent() or 'iphone' in UserAgent() %}
  
              &lt;script type="text/javascript"&gt;
  
              if(sessionStorage.getItem("count2")=='NaN')
              {
              sessionStorage.setItem("count2", 0);
              counters = 0;
              }
              if(sessionStorage.getItem("count2") == null)
              {
              sessionStorage.setItem("count2", 0);
              counters = 0;
              }
              else
              {
              counters= parseInt(sessionStorage.getItem("count2"));
              //alert(sessionStorage.getItem("count2"));
              }
              if (page_count == 4)
              {
              dataLayer.push({'event':'mobilePromo-iphone'});
              }
  
              &lt;/script&gt;
  
  
              {% endif %} 
              &lt;/body&gt;
  
  
              &lt;/html&gt;
  
              {% endspaceless %}
  </code></pre>
  
  <p>snapshot </p>
  
  <p><img src="https://i.stack.imgur.com/d9SVH.png" alt="enter image description here"></p>
  
  <ul>
  <li><p>while using spaceless spaces between html element are not removed.</p></li>
  <li><p>i need to remove the spaces between html elements.</p></li>
  <li><p>i  have found use trim in twig but where to used in code.</p></li>
  <li><p>any suggestion are most welcome. </p></li>
  </ul>