the "Apache Sling JSP Script Handler" has an OSGi configuration option "Trim spaces", seems to based on a Jasper feature.
i would favor such a switch for the sightly script handler as well, instead of introducing such features in the sightly language itself or making it conditional for some tags. if you want to remove whitespaces, all unnecessary whitespaces should be removed, not only those of elements with unwrap. stefan >-----Original Message----- >From: Konrad Windszus [mailto:konra...@gmx.de] >Sent: Thursday, December 11, 2014 11:41 AM >To: dev@sling.apache.org >Subject: Whitespace handling in Sightly > >Hi, >since JSP 2.1 it is possible to remove extra whitespace characters from the >generated servlet by leveraging the trim-directive-whitespaces element on the >page directive (JSP 2.1 Spec, $JSP.3.3.8). Does Sightly comes with something >similar? >One example which leads to unwanted empty lines is like > ><link data-sly-call=“templatea" data-sly-test.condition=“${true}" data-sly- >unwrap></link> ><link data-sly-call=“templateb" data-sly-test="${!condition}" data-sly- >unwrap></link> > >Since either the first or second template is called you would end up with one >empty newline (which is not wanted). > >Maybe data-sly-unwrap should also remove the line break from the output? >WDYT? > >Konrad