From f14150c20503187ab957b9484c34a10d9c22738e Mon Sep 17 00:00:00 2001 From: Tyler Akins Date: Wed, 2 Aug 2017 10:34:58 -0500 Subject: [PATCH] Fixing indentation of partials in a condition This is to address #19. --- mo | 2 +- tests/indented-partials.env | 1 + tests/indented-partials.expected | 4 ++++ tests/indented-partials.template | 5 +++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mo b/mo index 934c69b..dbf61a7 100755 --- a/mo +++ b/mo @@ -599,7 +599,7 @@ moParse() { elif moIsArray "$moTag"; then eval "moLoop \"\${moBlock[0]}\" \"$moTag\" \"\${!${moTag}[@]}\"" else - moParse "${moBlock[0]}" "$moCurrent" false + moParse "${moBlock[0]}" "$moCurrent" true fi fi diff --git a/tests/indented-partials.env b/tests/indented-partials.env index e69de29..de94754 100644 --- a/tests/indented-partials.env +++ b/tests/indented-partials.env @@ -0,0 +1 @@ +thisIsTrue=true diff --git a/tests/indented-partials.expected b/tests/indented-partials.expected index 73888d4..fd26756 100644 --- a/tests/indented-partials.expected +++ b/tests/indented-partials.expected @@ -17,3 +17,7 @@ With text text first line second line + +In a conditional + first line + second line diff --git a/tests/indented-partials.template b/tests/indented-partials.template index 8cc08f0..ace56d4 100644 --- a/tests/indented-partials.template +++ b/tests/indented-partials.template @@ -11,3 +11,8 @@ With text {{> indented-partials.partial}} text {{> indented-partials.partial}} + +In a conditional +{{#thisIsTrue}} + {{> indented-partials.partial}} +{{/thisIsTrue}}