Re: [Cppcms-users] templates: newline on every include
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-02-21 09:02:58
|
>I found that every time you include template inside of template, like: > ><% template call3() %> ><%= text %> ><% end template %> > ><% template call2() %> > <% include call3() %> ><% end template %> > ><% template call1() %> > <% include call2() %> ><% end template %> > ><% template render() %> ><html><body><h1> ><% include call1() %> ></h1></body></html> ><% end template %> > >cppcms_tmpl_cc wrapping it with empty newline (comments skipped): > > [snip] > >this results in newline on every "subtemplate" in output html-file: > > [snip] > >Easy workaround for now - edit generated source file after cppcms_tmpl_cc. > Or write the code like this: <% template call3() %><%= text %><% end template %> <% template call2() %><% include call3() %><% end template %> <% template call1() %><% include call2() %><% end template %> <% template render() %> <html> <body> <h1><% include call1() %></h1> </body> </html> <% end template %> ---------------- Everything withing the template tags rendered as-is that is why you see many "newlines" but they are actually in your sources. Artyom |