wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
outputfilter.html5_void_tags.php
Go to the documentation of this file.
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2014 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of any of the following licenses
7  * at your choice:
8  *
9  * - GNU Lesser General Public License (LGPL)
10  * http://www.gnu.org/licenses/lgpl.html
11  * - Eclipse Public License (EPL)
12  * http://www.eclipse.org/org/documents/epl-v10.php
13  *
14  * See the license.txt file distributed with this work for
15  * additional information.
16  *
17  * $Id: outputfilter.html5_void_tags.php 1164 2010-04-07 12:55:00Z iherwig $
18  */
19 
20 /*
21 * Smarty output filter
22 * -------------------------------------------------------------
23 * File: outputfilter.html5_void_tags.php
24 * Type: function
25 * Name: html5_void_tags
26 * Purpose: remove closing slashes from void tags according to html5
27 * -------------------------------------------------------------
28 */
29 function smarty_outputfilter_html5_void_tags($tpl_output, &$smarty)
30 {
31  // remove slashes from image tags
32  $tpl_output = preg_replace('/<img([^>]+) ?\/>/i', "<img $1>", $tpl_output);
33  // replace brs
34  $tpl_output = preg_replace("/<br ?\/>/i", "<br>", $tpl_output);
35 
36  return $tpl_output;
37 }
38 ?>
smarty_outputfilter_html5_void_tags($tpl_output, &$smarty)