Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip-block produces different output in Smarty v3.1.32 #436

Closed
rvock opened this issue Apr 30, 2018 · 2 comments
Closed

strip-block produces different output in Smarty v3.1.32 #436

rvock opened this issue Apr 30, 2018 · 2 comments

Comments

@rvock
Copy link

rvock commented Apr 30, 2018

Smarty v3.1.32 had an undocumented breaking change for the {strip}-Block:

{strip}
	<li>Code  <- two spaces</li>

	{*<!-- Comment -->*}
	<li>Code</li>
{/strip}

This Template would lead to the following HTML in Smarty v3.1.31:

<li>Code  <- two spaces</li><li>Code</li>

All linebreaks and multiple whitespace at start or end would be removed.

With Smarty v3.1.32 there is additional whitespace:

<li>Code  <- two spaces</li>	<li>Code</li>

This can break a lot of templates for menus, if they rely on the missing whitespace between the li-tags.

Just a note: If the comment is removed or there is an additional linebreak after the comment, everything works fine.

@uwetews
Copy link
Contributor

uwetews commented May 17, 2018

The fix is now in the master branch and will later be included in 3.1.33

@uwetews uwetews closed this as completed May 17, 2018
@biesbjerg
Copy link

Was this included in 3.1.33?

{strip}

	{* Evaluate and output header template *}
	<?xml version="1.0"?><rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0">
	<item>
		<description>...</description>
	</item>

{/strip}

Produces:

3.1.31:

<?xml version="1.0"?><rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0"><item><description>...</description></item>

3.1.33:

	<?xml version="1.0"?><rss version ="2.0" xmlns:g="http://base.google.com/ns/1.0"><item><description>...</description></item>

Notice the leading tab. If I remove the comment from the template there is no leading tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants