Skip to content

Commit cb99898

Browse files
committed
strip if you don't want newlines at the end of files
1 parent b2f0f79 commit cb99898

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cms/middleware/toolbar.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def toolbar_plugin_processor(instance, placeholder, rendered_content, original_c
3838
'move_url': placeholder.get_move_url(),
3939
}
4040
original_context.update(data)
41-
output = render_to_string(instance.get_plugin_class().frontend_edit_template, original_context)
41+
plugin_class = instance.get_plugin_class()
42+
template = plugin_class.frontend_edit_template
43+
output = render_to_string(template, original_context).strip()
4244
original_context.pop()
4345
return output
4446

cms/templatetags/cms_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def render_tag(self, context, **kwargs):
729729
context.push()
730730
template = self.get_template(context, **kwargs)
731731
data = self.get_context(context, **kwargs)
732-
output = render_to_string(template, data)
732+
output = render_to_string(template, data).strip()
733733
context.pop()
734734
if kwargs.get('varname'):
735735
context[kwargs['varname']] = output

0 commit comments

Comments
 (0)