Skip to content

Instantly share code, notes, and snippets.

@loominade
Created October 25, 2017 13:59
Show Gist options
  • Save loominade/df80e59530a8f7a83826943735558023 to your computer and use it in GitHub Desktop.
Save loominade/df80e59530a8f7a83826943735558023 to your computer and use it in GitHub Desktop.
diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine
index 177e01a511..cb78624cf8 100644
--- a/core/themes/engines/twig/twig.engine
+++ b/core/themes/engines/twig/twig.engine
@@ -74,8 +74,8 @@ function twig_render_template($template_file, array $variables) {
throw $e;
}
if ($twig_service->isDebug()) {
- $output['debug_prefix'] .= "\n\n<!-- THEME DEBUG -->";
- $output['debug_prefix'] .= "\n<!-- THEME HOOK: '" . Html::escape($variables['theme_hook_original']) . "' -->";
+ $output['debug_prefix'] .= "<!-- THEME DEBUG -->";
+ $output['debug_prefix'] .= "<!-- THEME HOOK: '" . Html::escape($variables['theme_hook_original']) . "' -->";
// If there are theme suggestions, reverse the array so more specific
// suggestions are shown first.
if (!empty($variables['theme_hook_suggestions'])) {
@@ -109,10 +109,10 @@ function twig_render_template($template_file, array $variables) {
$prefix = ($template == $current_template) ? 'x' : '*';
$suggestion = $prefix . ' ' . $template;
}
- $output['debug_info'] .= "\n<!-- FILE NAME SUGGESTIONS:\n " . Html::escape(implode("\n ", $suggestions)) . "\n-->";
+ $output['debug_info'] .= "<!-- FILE NAME SUGGESTIONS:\n " . Html::escape(implode("\n ", $suggestions)) . "\n-->";
}
- $output['debug_info'] .= "\n<!-- BEGIN OUTPUT from '" . Html::escape($template_file) . "' -->\n";
- $output['debug_suffix'] .= "\n<!-- END OUTPUT from '" . Html::escape($template_file) . "' -->\n\n";
+ $output['debug_info'] .= "<!-- BEGIN OUTPUT from '" . Html::escape($template_file) . "' -->";
+ $output['debug_suffix'] .= "<!-- END OUTPUT from '" . Html::escape($template_file) . "' -->";
}
// This output has already been rendered and is therefore considered safe.
return Markup::create(implode('', $output));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment