Massive overhaul of Mustache.php's whitespace handling.

Move regex preparation into methods, use named subpatterns so the regex makes more sense. Fix the logic around eating newlines adjacent to tags. Update tests to reflect the changes.
This commit is contained in:
Justin Hileman
2010-11-24 07:45:24 -05:00
parent d026315a2c
commit 3e6b8102b7
13 changed files with 87 additions and 98 deletions
@@ -1,17 +1,7 @@
grand_parent1
grand_parent1
parent1
grand_parent1
parent1
parent1-child1
grand_parent1
parent1
parent1-child2
grand_parent1
parent2
grand_parent1
parent2
parent2-child1
grand_parent1
parent2
parent2-child2
parent1 (grand_parent1)
parent1-child1 (parent1 << grand_parent1)
parent1-child2 (parent1 << grand_parent1)
parent2 (grand_parent1)
parent2-child1 (parent2 << grand_parent1)
parent2-child2 (parent2 << grand_parent1)