Issue Details (XML | Word | Printable)

Key: GRAILS-1893
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Graeme Rocher
Reporter: Silvio Wangler
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Grails

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

Created: 27/Nov/07 06:45 AM   Updated: 27/Apr/08 08:55 AM   Resolved: 27/Apr/08 08:55 AM
Component/s: TagLib
Affects Version/s: 1.0-RC1
Fix Version/s: 1.0.2

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive grails taglib issue.zip (2 kB)

Environment: winxp (sp2)


 Description  « Hide

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.



Silvio Wangler added a comment - 27/Nov/07 10:37 AM

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
<%
}
%>


Silvio Wangler added a comment - 27/Nov/07 10:54 AM

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.


Silvio Wangler added a comment - 27/Apr/08 08:55 AM

With 1.0.2 every thing works as expected.