Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Line break missing

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
voidv
Smarty n00b


Joined: 12 Apr 2012
Posts: 3

PostPosted: Thu Apr 12, 2012 12:09 pm    Post subject: Line break missing Reply with quote

Hi, I encountered this problem during migration from using smarty2 to smarty3. Please see my code and problem below...

Here is the template code fragment:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">


Here is the smarty generated cache code fragment for the template above:
Code:
<?php echo '<?xml';?> version="1.0" encoding="utf-8"<?php echo '?>';?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">


Here is the source code view of the actual page in the browser:
Code:
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">


Noticed that the line break between two lines is missing.


I have tried all the possible configurations and none of them will solve this problem.

But if I add a space after the first line in the cache file like this:
Code:
<?php echo '<?xml';?> version="1.0" encoding="utf-8"<?php echo '?>';?>[i][SPACE][/i]
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

The line break will be normally displayed.

I guess for lines end with a php ending tag "?>" that smarty would not output the line break after and that do make sense.

But for this case the line break is needed.

Just wondering if there is any way of fixing this problem except use {literal} tag to surround the "?>"......
Back to top
View user's profile Send private message
voidv
Smarty n00b


Joined: 12 Apr 2012
Posts: 3

PostPosted: Thu Apr 12, 2012 12:11 pm    Post subject: Reply with quote

Sorry that I forgot to put the version info.

* Project: Smarty: the PHP compiling template engine
* File: Smarty.class.php
* SVN: $Id: Smarty.class.php 4445 2011-10-21 18:40:16Z rodneyrehm $
*
* @link http://www.smarty.net/
* @copyright 2008 New Digital Group, Inc.
* @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews
* @author Rodney Rehm
* @package Smarty
* @version 3.1.5
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Apr 12, 2012 3:50 pm    Post subject: Reply with quote

This bug is fixed now in ths SVN trunk version and will later be included in version 3.1.9
Back to top
View user's profile Send private message
voidv
Smarty n00b


Joined: 12 Apr 2012
Posts: 3

PostPosted: Fri Apr 13, 2012 3:05 am    Post subject: Reply with quote

U.Tews wrote:
This bug is fixed now in ths SVN trunk version and will later be included in version 3.1.9


Nice~! ^_^

Thanks a lot for replying.
Wink
Back to top
View user's profile Send private message
fisher
Smarty n00b


Joined: 13 Apr 2012
Posts: 1

PostPosted: Fri Apr 13, 2012 7:47 am    Post subject: Reply with quote

voidv wrote:
U.Tews wrote:
This bug is fixed now in ths SVN trunk version and will later be included in version 3.1.9


Nice~! ^_^

Thanks a lot for replying.
Wink



What is the error cause?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP