comparison test/test_templating.py @ 4647:11b6601629d7

#2550759: Trailing punctuation is no longer included when URLs are converted to links.
author Ezio Melotti <ezio.melotti@gmail.com>
date Sat, 14 Jul 2012 02:39:23 +0200
parents 399569ff4aed
children fd72576e07ed
comparison
equal deleted inserted replaced
4646:cd81ebbce7f9 4647:11b6601629d7
171 '(e.g. <a href="http://en.wikipedia.org/wiki/Python_(programming_language)">' 171 '(e.g. <a href="http://en.wikipedia.org/wiki/Python_(programming_language)">'
172 'http://en.wikipedia.org/wiki/Python_(programming_language)</a>)&gt;.') 172 'http://en.wikipedia.org/wiki/Python_(programming_language)</a>)&gt;.')
173 ae(t('(e.g. http://en.wikipedia.org/wiki/Python_(programming_language&gt;)).'), 173 ae(t('(e.g. http://en.wikipedia.org/wiki/Python_(programming_language&gt;)).'),
174 '(e.g. <a href="http://en.wikipedia.org/wiki/Python_(programming_language">' 174 '(e.g. <a href="http://en.wikipedia.org/wiki/Python_(programming_language">'
175 'http://en.wikipedia.org/wiki/Python_(programming_language</a>&gt;)).') 175 'http://en.wikipedia.org/wiki/Python_(programming_language</a>&gt;)).')
176 for c in '.,;:!':
177 # trailing punctuation is not included
178 ae(t('http://roundup.net/%c ' % c),
179 '<a href="http://roundup.net/">http://roundup.net/</a>%c ' % c)
180 # but it's included if it's part of the URL
181 ae(t('http://roundup.net/%c/' % c),
182 '<a href="http://roundup.net/%c/">http://roundup.net/%c/</a>' % (c, c))
176 183
177 ''' 184 '''
178 class HTMLPermissions: 185 class HTMLPermissions:
179 def is_edit_ok(self): 186 def is_edit_ok(self):
180 def is_view_ok(self): 187 def is_view_ok(self):

Roundup Issue Tracker: http://roundup-tracker.org/