mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
Moar cleanup.
This commit is contained in:
parent
43f82ba42b
commit
b4f01103dc
2 changed files with 3 additions and 9 deletions
|
@ -8,12 +8,6 @@ def in_list(value, arg):
|
|||
return value in arg
|
||||
|
||||
@register.filter
|
||||
def highlight(snippet, maxlines=None):
|
||||
def highlight(snippet):
|
||||
h = pygmentize(snippet.content, snippet.lexer)
|
||||
if not h:
|
||||
s = snippet.content.splitlines()
|
||||
s = h.splitlines()
|
||||
|
||||
if maxlines:
|
||||
return s[:maxlines]
|
||||
return s
|
||||
return h.splitlines()
|
||||
|
|
|
@ -60,4 +60,4 @@ class SnippetTestCase(TestCase):
|
|||
response = self.client.post(response.request['PATH_INFO'], data, follow=True)
|
||||
self.assertContains(response, data['content'])
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(Snippet.objects.count(), 2)
|
||||
self.assertEqual(Snippet.objects.count(), 2)
|
||||
|
|
Loading…
Reference in a new issue