Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Disturbing GT::Template feature

Quote Reply
Disturbing GT::Template feature
If a template line has only tags in it, which has no inserted content, like <%if ...%>, <%else%>,
<%endif%>, <%loop%>, <%endloop%>... etc., after the template parsing, there will be a blank line as result, instead of removing the helper line, which was inserted only to hold the template tags.
This makes very messy result html pages with much air (linefeeds) in it ...

Let me show an example template code part:
Code:
---------------<br>
<%if category%>
This is the category: <%category%><br>
<%if category%>
---------------<br>


The parsed html result page will be look like:
Code:
---------------<br>

This is the category: Computers/Accessories<br>

---------------<br>
Note the lines in place of the tags...


The displayed html will appear normally:
Code:
---------------
This is the category: Computers/Accessories
---------------

So while the template code is readable easily, the parsed html pages are very unreadable, which makes debugging more difficult. Moreover, if you want to create crossbrowser html pages using tables, which looks the same in IE & NS, the inserted lines makes difficult the template creating work.

Would be possible to correct the template parser in the following condition?:
- if there is a line with template tags and spaces only, which are not inserting real content, like: if, else, endif, loop, endloop, etc. tags. If this is true, then delete the blank line from the parsed html result.

I mean a regexp something like e.g.:
Code:
$text =~ s/\s*<%(^if|^else|^elsif|^end)+%>\s*\n//mgi;
It may be not correct syntactically, but it shows the basic idea.

This bug disturbs me since Links 2.0, and I think it should be corrected.

Would be possible?
This would help, avoiding such problems I had.


Reference to this post is here:
http://www.gossamer-threads.com/...orum.cgi?post=195579

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Subject Author Views Date
Thread Disturbing GT::Template feature webmaster33 4678 May 14, 2002, 12:49 AM
Thread Re: [webmaster33] Disturbing GT::Template feature
Paul 4493 May 14, 2002, 3:01 AM
Thread Re: [Paul] Disturbing GT::Template feature
webmaster33 4552 May 14, 2002, 3:22 AM
Thread Re: [webmaster33] Disturbing GT::Template feature
Paul 4518 May 14, 2002, 3:33 AM
Post Re: [Paul] Disturbing GT::Template feature
webmaster33 4453 May 14, 2002, 3:51 AM
Thread Re: [webmaster33] Disturbing GT::Template feature
Paul 4499 May 14, 2002, 3:37 AM
Thread Re: [Paul] Disturbing GT::Template feature
webmaster33 4548 May 14, 2002, 3:48 AM
Thread Re: [webmaster33] Disturbing GT::Template feature
Paul 4449 May 14, 2002, 3:59 AM
Thread Re: [Paul] Disturbing GT::Template feature
webmaster33 4493 May 14, 2002, 4:20 AM
Post Re: [webmaster33] Disturbing GT::Template feature
yogi 4473 May 14, 2002, 4:38 AM
Thread Re: [webmaster33] Disturbing GT::Template feature
Alex 4445 May 14, 2002, 9:59 AM
Post Re: [Alex] Disturbing GT::Template feature
webmaster33 4455 May 14, 2002, 11:09 AM