From a073987d9a86884a131a9b228e72e1f71eff671e Mon Sep 17 00:00:00 2001 From: Alan Yee Date: Mon, 25 Nov 2019 10:52:12 -0800 Subject: [PATCH] Update renderer.py More efficient to use rpartition over split in this use case --- chevron/renderer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chevron/renderer.py b/chevron/renderer.py index 99415da..af3e0a8 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -338,7 +338,7 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', partials_path, partials_ext) # Find what to pad the partial with - left = output.split('\n')[-1] + left = output.rpartition('\n')[2] part_padding = padding if left.isspace(): part_padding += left -- 2.47.3