From 40d18bb8250ff41964a7527fdb4acbfb835da04c Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Thu, 3 Jan 2013 00:22:48 -0200 Subject: [PATCH] fix html source code view --- src/GitList/Application.php | 1 + views/file.twig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GitList/Application.php b/src/GitList/Application.php index 7f7e2cd..99e97f8 100644 --- a/src/GitList/Application.php +++ b/src/GitList/Application.php @@ -48,6 +48,7 @@ class Application extends SilexApplication $this->register(new RoutingUtilServiceProvider()); $this['twig'] = $this->share($this->extend('twig', function($twig, $app) { + $twig->addFilter('htmlentities', new \Twig_Filter_Function('htmlentities')); $twig->addFilter('md5', new \Twig_Filter_Function('md5')); return $twig; diff --git a/views/file.twig b/views/file.twig index 8b530d2..71adbec 100644 --- a/views/file.twig +++ b/views/file.twig @@ -24,7 +24,7 @@
{{ blob }}
{% else %} -
{{ blob }}
+
{{ blob|htmlentities|raw }}
{% endif %}