1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Used %r in the TextNode repr to show newlines better.

This commit is contained in:
Ned Batchelder
2015-06-20 07:37:43 -04:00
committed by Tim Graham
parent c31bf8cb54
commit 3b81dbe844
2 changed files with 19 additions and 3 deletions

View File

@@ -976,8 +976,8 @@ class TextNode(Node):
self.s = s
def __repr__(self):
return force_str("<Text Node: '%s'>" % self.s[:25], 'ascii',
errors='replace')
rep = "<%s: %r>" % (self.__class__.__name__, self.s[:25])
return force_str(rep, 'ascii', errors='replace')
def render(self, context):
return self.s