Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
ed2f9681
Kaydet (Commit)
ed2f9681
authored
Eki 31, 2014
tarafından
Markus Holtermann
Kaydeden (comit)
Tim Graham
Eki 31, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23715 -- Prevented urlize from treating a trailing ! as part of an URL
Thanks to 57even for the report.
üst
98da4089
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
AUTHORS
AUTHORS
+1
-1
html.py
django/utils/html.py
+1
-1
1.8.txt
docs/releases/1.8.txt
+4
-0
tests.py
tests/defaultfilters/tests.py
+12
-2
No files found.
AUTHORS
Dosyayı görüntüle @
ed2f9681
...
@@ -430,7 +430,7 @@ answer newbie questions, and generally made Django that much better:
...
@@ -430,7 +430,7 @@ answer newbie questions, and generally made Django that much better:
mark@junklight.com
mark@junklight.com
Mark Lavin <markdlavin@gmail.com>
Mark Lavin <markdlavin@gmail.com>
Mark Sandstrom <mark@deliciouslynerdy.com>
Mark Sandstrom <mark@deliciouslynerdy.com>
Markus Holtermann <http://markusholtermann.eu>
Markus Holtermann <http
s
://markusholtermann.eu>
martin.glueck@gmail.com
martin.glueck@gmail.com
Martin Green
Martin Green
Martin Kosír <martin@martinkosir.net>
Martin Kosír <martin@martinkosir.net>
...
...
django/utils/html.py
Dosyayı görüntüle @
ed2f9681
...
@@ -19,7 +19,7 @@ from .html_parser import HTMLParser, HTMLParseError
...
@@ -19,7 +19,7 @@ from .html_parser import HTMLParser, HTMLParseError
# Configuration for urlize() function.
# Configuration for urlize() function.
TRAILING_PUNCTUATION
=
[
'.'
,
','
,
':'
,
';'
,
'.)'
,
'"'
,
'
\'
'
]
TRAILING_PUNCTUATION
=
[
'.'
,
','
,
':'
,
';'
,
'.)'
,
'"'
,
'
\'
'
,
'!'
]
WRAPPING_PUNCTUATION
=
[(
'('
,
')'
),
(
'<'
,
'>'
),
(
'['
,
']'
),
(
'<'
,
'>'
),
(
'"'
,
'"'
),
(
'
\'
'
,
'
\'
'
)]
WRAPPING_PUNCTUATION
=
[(
'('
,
')'
),
(
'<'
,
'>'
),
(
'['
,
']'
),
(
'<'
,
'>'
),
(
'"'
,
'"'
),
(
'
\'
'
,
'
\'
'
)]
# List of possible strings used for bullets in bulleted lists.
# List of possible strings used for bullets in bulleted lists.
...
...
docs/releases/1.8.txt
Dosyayı görüntüle @
ed2f9681
...
@@ -343,6 +343,10 @@ Templates
...
@@ -343,6 +343,10 @@ Templates
the top-level domain (e.g. ``djangoproject.com/`` and
the top-level domain (e.g. ``djangoproject.com/`` and
``djangoproject.com/download/``).
``djangoproject.com/download/``).
* :tfilter:`urlize` doesn't treat exclamation marks at the end of a domain or
its query string as part of the URL (the URL in e.g. ``'djangoproject.com!``
is ``djangoproject.com``)
Requests and Responses
Requests and Responses
^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^
...
...
tests/defaultfilters/tests.py
Dosyayı görüntüle @
ed2f9681
...
@@ -282,8 +282,8 @@ class DefaultFiltersTests(TestCase):
...
@@ -282,8 +282,8 @@ class DefaultFiltersTests(TestCase):
'<a href="http://hi.baidu.com/
%
E9
%87%8
D
%
E6
%96%
B0
%
E5
%
BC
%80%
E5
%
A7
%8
B" rel="nofollow">'
'<a href="http://hi.baidu.com/
%
E9
%87%8
D
%
E6
%96%
B0
%
E5
%
BC
%80%
E5
%
A7
%8
B" rel="nofollow">'
'http://hi.baidu.com/
%
E9
%87%8
D
%
E6
%96%
B0
%
E5
%
BC
%80%
E5
%
A7
%8
B</a>'
)
'http://hi.baidu.com/
%
E9
%87%8
D
%
E6
%96%
B0
%
E5
%
BC
%80%
E5
%
A7
%8
B</a>'
)
self
.
assertEqual
(
urlize
(
'www.mystore.com/30
%
OffCoupons!'
),
self
.
assertEqual
(
urlize
(
'www.mystore.com/30
%
OffCoupons!'
),
'<a href="http://www.mystore.com/30
%25
OffCoupons
!
" rel="nofollow">'
'<a href="http://www.mystore.com/30
%25
OffCoupons" rel="nofollow">'
'www.mystore.com/30
%
OffCoupons
!</a>
'
)
'www.mystore.com/30
%
OffCoupons
</a>!
'
)
self
.
assertEqual
(
urlize
(
'http://en.wikipedia.org/wiki/Caf
%
C3
%
A9'
),
self
.
assertEqual
(
urlize
(
'http://en.wikipedia.org/wiki/Caf
%
C3
%
A9'
),
'<a href="http://en.wikipedia.org/wiki/Caf
%
C3
%
A9" rel="nofollow">'
'<a href="http://en.wikipedia.org/wiki/Caf
%
C3
%
A9" rel="nofollow">'
'http://en.wikipedia.org/wiki/Caf
%
C3
%
A9</a>'
)
'http://en.wikipedia.org/wiki/Caf
%
C3
%
A9</a>'
)
...
@@ -370,6 +370,16 @@ class DefaultFiltersTests(TestCase):
...
@@ -370,6 +370,16 @@ class DefaultFiltersTests(TestCase):
self
.
assertEqual
(
urlize
(
'Email us at "hi@example.com", or phone us at +xx.yy'
),
self
.
assertEqual
(
urlize
(
'Email us at "hi@example.com", or phone us at +xx.yy'
),
'Email us at "<a href="mailto:hi@example.com">hi@example.com</a>", or phone us at +xx.yy'
)
'Email us at "<a href="mailto:hi@example.com">hi@example.com</a>", or phone us at +xx.yy'
)
# Check urlize correctly handles exclamation marks after TLDs or query string - see #23715
self
.
assertEqual
(
urlize
(
'Go to djangoproject.com! and enjoy.'
),
'Go to <a href="http://djangoproject.com" rel="nofollow">djangoproject.com</a>! and enjoy.'
)
self
.
assertEqual
(
urlize
(
'Search for google.com/?q=! and see.'
),
'Search for <a href="http://google.com/?q=" rel="nofollow">google.com/?q=</a>! and see.'
)
self
.
assertEqual
(
urlize
(
'Search for google.com/?q=dj!`? and see.'
),
'Search for <a href="http://google.com/?q=dj
%21%60%3
F" rel="nofollow">google.com/?q=dj!`?</a> and see.'
)
self
.
assertEqual
(
urlize
(
'Search for google.com/?q=dj!`?! and see.'
),
'Search for <a href="http://google.com/?q=dj
%21%60%3
F" rel="nofollow">google.com/?q=dj!`?</a>! and see.'
)
def
test_wordcount
(
self
):
def
test_wordcount
(
self
):
self
.
assertEqual
(
wordcount
(
''
),
0
)
self
.
assertEqual
(
wordcount
(
''
),
0
)
self
.
assertEqual
(
wordcount
(
'oneword'
),
1
)
self
.
assertEqual
(
wordcount
(
'oneword'
),
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment