utils.str.format: Replace %u with '' instead of '<>' if URL is empty.

This commit is contained in:
Valentin Lorentz 2013-08-13 19:19:54 +00:00
parent 3a5c4c3ddd
commit 8d7b06efd1
1 changed files with 5 additions and 1 deletions

View File

@ -511,7 +511,11 @@ def format(s, *args, **kwargs):
return timeElapsed(args.pop())
elif char == 'u':
import supybot.conf as conf
return conf.supybot.reply.format.url() % args.pop()
url = args.pop()
if url:
return conf.supybot.reply.format.url() % url
else:
return ''
elif char == 'v':
args.pop()
return ''