Issue Details (XML | Word | Printable)

Key: GRAILS-3277
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Marc Palmer
Reporter: Jean-Noël Rivasseau
Votes: 1
Watchers: 3
Operations

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

Fix the GSP engine so that it does not remove newlines (or add an option)

Created: 24/Jul/08 01:18 PM   Updated: 19/Nov/08 05:08 AM   Resolved: 19/Nov/08 05:08 AM
Return to search
Component/s: View technologies
Affects Version/s: 1.0.3
Fix Version/s: 1.1-beta1

Time Tracking:
Not Specified


 Description  « Hide

In a sample GSP file:

<div>
<g:message code="general.text" />

<g:message code="general.text" />

<g:message code="general.text" />
</div>

the produced result is

<div>
Hello WorldHello WorldHello World
</div>

instead of what I would expect:

<div>
Hello World

Hello World

Hello World
</div>

So the GSP engine removes the newlines. This causes problem when rendering plain text (in XML / HTML it generally does not matter).

Tabs and spaces are not removed. If you put some newliens and then a space, the newlines wont even be removed - it appears the code removes all the new line characters next to a GSP tag, apparently.

This is probably an easy fix although beware of regressions I guess maybe an option should be added to remove or not remove the newlines, but I cannot see a situation where removing them would be useful (although the contrary, always removing them, clearly is problematic).



Marc Palmer made changes - 10/Sep/08 04:46 AM
Field Original Value New Value
Assignee Graeme Rocher [ graemerocher ] Marc Palmer [ wangjammer5 ]
Marc Palmer made changes - 10/Sep/08 06:16 AM
Status Open [ 1 ] In Progress [ 3 ]
Graeme Rocher made changes - 14/Nov/08 07:34 AM
Fix Version/s 1.0.4 [ 14156 ]
Fix Version/s 1.0.5 [ 14721 ]
Marc Palmer made changes - 19/Nov/08 05:06 AM
Fix Version/s 1.0.5 [ 14721 ]
Fix Version/s 1.1-beta1 [ 13674 ]
Marc Palmer added a comment - 19/Nov/08 05:08 AM

GSP now preserves most whitespace. Tags can control the behaviour, tags updated to correct behaviour.

Tag tests need to bear in mind there is whitespace now. Best to trim before compare / filter all WS.


Marc Palmer made changes - 19/Nov/08 05:08 AM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Closed [ 6 ]