From 7807fca367008ceaa8ff1b5a1b7f040520ee1cad Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sun, 8 Jan 2012 21:54:57 +0100 Subject: Win/Mac newlines are now treated correctly at beginning of a TextNode. --- stupid_template_engine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'stupid_template_engine.php') diff --git a/stupid_template_engine.php b/stupid_template_engine.php index fc22a81..2e11ed4 100644 --- a/stupid_template_engine.php +++ b/stupid_template_engine.php @@ -136,7 +136,7 @@ function tokenize_text($text, $tpl, $off) if(preg_match("/(?:(?text = preg_replace("/^\\n\\s*/s", "", unescape_text($text)); + $node->text = preg_replace("/^(?:\\n|\\r\\n|\\r)\\s*/s", "", unescape_text($text)); return (strlen($node->text) == 0) ? array() : array($node); } -- cgit v1.2.3-70-g09d2