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

New line in doRender of Engine class #47

Closed
nr1q opened this issue Nov 6, 2016 · 3 comments
Closed

New line in doRender of Engine class #47

nr1q opened this issue Nov 6, 2016 · 3 comments

Comments

@nr1q
Copy link

nr1q commented Nov 6, 2016

Hello Giuseppe, I'm making a wordpress theme that uses Foil, I see a difference on the output when using the get_template_part() and $this->insert() or $this->section() or similar; it's like if the new lines at the end of each section/part gets deleted:

For example, this:

<html <?php language_attributes() ?>>
<?php #get_template_part('templates/head'); ?>
<?= $T->insert('head') ?>

<body <?php body_class() ?>>

Outputs:

<html lang="es-MX">
<head>
...
</head>
<body class="home blog">

The space (or newline) between closing head and body is deleted or if is a closing tag –which I like to have on its own line– merges with the preceding line, so it changes a little bit the expected result. I know is not a critical thing but I'd like to have the same behavior than the wordpress function.

Checking the source I saw that a workaround might be to add the newline in doRender() method of the Engine class:

        $output = trim($template->render($data)) . PHP_EOL;

What you think?

@barryo
Copy link
Contributor

barryo commented Nov 6, 2016

This was most likely solved for you in #44 which is in dev branch.

@gmazzap
Copy link
Contributor

gmazzap commented Nov 7, 2016

@nr1q please ckeck that using dev branch the issue is solved. I will merge soon in master.

@nr1q
Copy link
Author

nr1q commented Nov 7, 2016

Sorry, I forgot to check the branch… Thanks to both of you!

@nr1q nr1q closed this as completed Nov 7, 2016
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