Add `keep_trailing_newline` to configure final endline stripping
This option defaults to False for compatibility with the existing
behaviour. I've added the option because I expect I won't remember to
keep an extra trailing newline in my templates, and some non-HTML
templates *need* that last newline.
See also:
https://groups.google.com/d/msg/pocoo-libs/6DylMqq1voI/GXTbZJ1Tr-sJ
diff --git a/CHANGES b/CHANGES
index 6539c5f..43f5e8f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -13,6 +13,8 @@
- Added `urlencode` filter that automatically quotes values for
URL safe usage with utf-8 as only supported encoding. If applications
want to change this encoding they can override the filter.
+- Added `keep-trailing-newline` configuration to environments and
+ templates to optionally preserve the final trailing newline.
- Accessing `last` on the loop context no longer causes the iterator
to be consumed into a list.