Mercurial > p > roundup > code
comparison roundup/cgi/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 | a2eb4fb3e6d8 |
| children | beb8d43f4d9d |
comparison
equal
deleted
inserted
replaced
| 4646:cd81ebbce7f9 | 4647:11b6601629d7 |
|---|---|
| 1275 if '>' in s: | 1275 if '>' in s: |
| 1276 # catch an escaped ">" in the URL | 1276 # catch an escaped ">" in the URL |
| 1277 pos = s.find('>') | 1277 pos = s.find('>') |
| 1278 end = s[pos:] | 1278 end = s[pos:] |
| 1279 u = s = s[:pos] | 1279 u = s = s[:pos] |
| 1280 if s.endswith(tuple('.,;:!')): | |
| 1281 # don't include trailing punctuation | |
| 1282 end = s[-1:] + end | |
| 1283 u = s = s[:-1] | |
| 1280 if ')' in s and s.count('(') != s.count(')'): | 1284 if ')' in s and s.count('(') != s.count(')'): |
| 1281 # don't include extraneous ')' in the link | 1285 # don't include extraneous ')' in the link |
| 1282 pos = s.rfind(')') | 1286 pos = s.rfind(')') |
| 1283 end = s[pos:] + end | 1287 end = s[pos:] + end |
| 1284 u = s = s[:pos] | 1288 u = s = s[:pos] |
