Grails

<g:each> tag removes line breaks in gsp views

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-RC1
  • Fix Version/s: 1.0.2
  • Component/s: TagLib
  • Labels:
    None
  • Environment:
    winxp (sp2)

Description

I am trying to generate a ics calendar file using a gsp view. whenever I use the <g:each> tag it somehow removes some line breaks and the output file can not be parsed by any calendar app such as outlook, mozilla sunbird...

It seems that <g:each> tag removes line brakes in gsp views. please see view 'calendar.gsp' which contains a standalone example of the behavior. in 'calendar-actual-output.ics' the actual output of the view and in 'calendar-expected-output.ics' you will find the excpected output.

Activity

Hide
Silvio Wangler added a comment -

I need to add some extra info.

the line breaks are not removed by the <g:each> tag. even if I replace the tag with a for-loop the line breaks disapear somehow. I haven't found out yet why some line breaks remain.

<%
for(int i=0; i < games.size(); i++)
{
Game game = games.get;
%>
// do ical stuff
<%
}
%>

Show
Silvio Wangler added a comment - I need to add some extra info. the line breaks are not removed by the <g:each> tag. even if I replace the tag with a for-loop the line breaks disapear somehow. I haven't found out yet why some line breaks remain. <% for(int i=0; i < games.size(); i++) { Game game = games.get; %> // do ical stuff <% } %>
Hide
Silvio Wangler added a comment -

I think I found the problem.

Each line which ends with a GString (e.g. DESCRIPTION:Mozilla Alarm: ${game.homeTeam.name} - ${game.guestTeam.name}) will cause to remove the following line break. If I add any character after the GString (e.g. (three dots) DESCRIPTION:Mozilla Alarm: ${game.homeTeam.name} - ${game.guestTeam.name}...) the line break remains.

Show
Silvio Wangler added a comment - I think I found the problem. Each line which ends with a GString (e.g. DESCRIPTION:Mozilla Alarm: ${game.homeTeam.name} - ${game.guestTeam.name}) will cause to remove the following line break. If I add any character after the GString (e.g. (three dots) DESCRIPTION:Mozilla Alarm: ${game.homeTeam.name} - ${game.guestTeam.name}...) the line break remains.
Hide
Silvio Wangler added a comment -

With 1.0.2 every thing works as expected.

Show
Silvio Wangler added a comment - With 1.0.2 every thing works as expected.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: