summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2012-01-08 21:54:57 +0100
committerKevin Chabowski <kevin@kch42.de>2012-01-08 21:54:57 +0100
commit7807fca367008ceaa8ff1b5a1b7f040520ee1cad (patch)
treed2334a0ff560de179db423f5bd3e111593716baf
parent5dae0519c2aef646938e5391cc28632ce0b2fc79 (diff)
downloadste-7807fca367008ceaa8ff1b5a1b7f040520ee1cad.tar.gz
ste-7807fca367008ceaa8ff1b5a1b7f040520ee1cad.tar.bz2
ste-7807fca367008ceaa8ff1b5a1b7f040520ee1cad.zip
Win/Mac newlines are now treated correctly at beginning of a TextNode.
-rw-r--r--stupid_template_engine.php2
1 files changed, 1 insertions, 1 deletions
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("/(?:(?<!\\\\)\\$)/s", $text, $match, PREG_OFFSET_CAPTURE) == 0)
{
$node = new TextNode($tpl, $off);
- $node->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);
}