summaryrefslogtreecommitdiff
path: root/django/utils/text.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-11-14 12:20:44 -0500
committerTim Graham <timograham@gmail.com>2016-11-14 12:20:44 -0500
commit6072de727f0ffa7bf0aa67aadba5d4589561974d (patch)
tree9168ba22bc956ff4154215c52ca5fe93770712de /django/utils/text.py
parentcbae4d31847d75d889815bfe7c04af035f45e28d (diff)
Decorated a few functions.
Diffstat (limited to 'django/utils/text.py')
-rw-r--r--django/utils/text.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/utils/text.py b/django/utils/text.py
index ec7af5389c..4f8ef9b31b 100644
--- a/django/utils/text.py
+++ b/django/utils/text.py
@@ -20,10 +20,11 @@ if six.PY2:
from django.utils.encoding import force_unicode # NOQA
-# Capitalizes the first letter of a string.
+@keep_lazy_text
def capfirst(x):
+ """Capitalize the first letter of a string."""
return x and force_text(x)[0].upper() + force_text(x)[1:]
-capfirst = keep_lazy_text(capfirst)
+
# Set up regular expressions
re_words = re.compile(r'<.*?>|((?:\w[-\w]*|&.*?;)+)', re.U | re.S)