From: Alan Yee Date: Mon, 25 Nov 2019 18:52:12 +0000 (-0800) Subject: Update renderer.py X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=a073987d9a86884a131a9b228e72e1f71eff671e;p=chevron.git Update renderer.py More efficient to use rpartition over split in this use case --- 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