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:
<%if category%>
This is the category: <%category%><br>
<%if category%>
---------------<br>
The parsed html result page will be look like:
This is the category: Computers/Accessories<br>
---------------<br>Note the lines in place of the tags...
The displayed html will appear normally:
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.:
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...
<%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>
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; 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...