From 5006d4d510f84d6f94c81ca7f7da33d5d740f9e7 Mon Sep 17 00:00:00 2001 From: mohrt Date: Wed, 26 Feb 2003 22:16:14 +0000 Subject: [PATCH] add nl2br modifier --- NEWS | 3 ++- libs/plugins/modifier.nl2br.php | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 libs/plugins/modifier.nl2br.php diff --git a/NEWS b/NEWS index e5588aeb..91e9a52a 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ + - added nl2br modifier to distribution (Monte) - added html_image to distribution (Monte) - - added cat modifier (Monte) + - added cat modifier to distribution (Monte) - added << >> <> support to if statments (SMK, Monte) - fix _assign_smarty_interface to not overwrite keys other than 'request' (Jerome Poudevigne, Monte) diff --git a/libs/plugins/modifier.nl2br.php b/libs/plugins/modifier.nl2br.php new file mode 100644 index 00000000..502e9cec --- /dev/null +++ b/libs/plugins/modifier.nl2br.php @@ -0,0 +1,25 @@ + + * Purpose: convert \r\n, \r or \n to
+ * Input: contents = contents to replace + * preceed_test = if true, includes preceeding break tags + * in replacement + * Example: {$text|nl2br} + * ------------------------------------------------------------- + */ +function smarty_modifier_nl2br($string) +{ + return nl2br($string); +} + +/* vim: set expandtab: */ + +?>