From 9d8289caf0dd47316a265042ab08a4382f8fc2a3 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 20 Dec 2014 11:16:01 -0800 Subject: [PATCH] Updated docs for whitespace+newline trimming. --- README.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b18d510..f6624f4 100644 --- a/README.md +++ b/README.md @@ -359,31 +359,36 @@ contexts will not be searched when resolving subcomponents. Newline trimming ---------------- -If the opening or closing section tag are the only thing on a line, any newline following the tag -is trimmed. This allows for civilized templates, like: +If the opening or closing section tag are the only thing on a line, any surrounding whitespace and +the line terminator following the tag are trimmed. This allows for civilized templates, like: Favorite foods: - {{#people}} - - {{first_name}} {{last_name}} likes {{favorite_food}}. - {{/people}} + which produces output like: Favorite foods: - - Elvis Presley likes peanut butter. - - Mahatma Gandhi likes aloo dum. + rather than: Favorite foods: - - - Elvis Presley likes peanut butter. - - - Mahatma Gandhi likes aloo dum. - + -which would be produced without the newline trimming. Note: the current implementation does not -handle Windows-style CRLF data. If you're a Windows user, how about sending me a patch? +which would be produced without the newline trimming. Nested Contexts ---------------