Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #1919 -- filter truncatewords is inefficient and destroys white space #1175

Closed
wants to merge 1 commit into from

Conversation

qris
Copy link
Contributor

@qris qris commented May 19, 2013

Used @arien's patch and @SmileyChris' comments, integrated with current code, hopefully made even more efficient for long strings by not splitting and rejoining them.

https://code.djangoproject.com/ticket/1919

Used @arien's patch and @SmileyChris' comments, integrated with current
code, hopefully made even more efficient for long strings by not
splitting and rejoining them.

https://code.djangoproject.com/ticket/1919
@timgraham
Copy link
Member

buildbot, test this please.

return self.add_truncation_text(' '.join(words), truncate)
return ' '.join(words)
if max_words < 1:
return u''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove u'' prefix (syntax error on Python 3.2 and unnecessary since this file has from __future__ import unicode_literals).

@timgraham
Copy link
Member

Please send a new PR if you can update, thanks.

@timgraham timgraham closed this Aug 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants