mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 05:02:32 +01:00
Google: Decode URLs. Closes GH-1260.
This commit is contained in:
parent
866d95ca0b
commit
fa755c3a9c
@ -82,7 +82,7 @@ class Google(callbacks.PluginRegexp):
|
||||
results = []
|
||||
for match in matches:
|
||||
r = dict(zip(('url', 'title', 'cacheUrl', 'content'), match))
|
||||
r['url'] = utils.web.htmlToText(r['url'].split('&')[0])
|
||||
r['url'] = utils.web.urlunquote(utils.web.htmlToText(r['url'].split('&')[0]))
|
||||
results.append(r)
|
||||
return results
|
||||
|
||||
|
@ -54,6 +54,12 @@ class GoogleTestCase(ChannelPluginTestCase):
|
||||
# Unicode check
|
||||
self.assertNotError('google ae')
|
||||
|
||||
def testUrlDecode(self):
|
||||
self.assertRegexp(
|
||||
'google site:http://www.urbandictionary.com carajo land',
|
||||
'\x02Urban Dictionary: carajo land\x02: '
|
||||
'https?://www.urbandictionary.com/define.php\?term=carajo%20land')
|
||||
|
||||
def testLucky(self):
|
||||
self.assertResponse('lucky Hacker News',
|
||||
'https://news.ycombinator.com/')
|
||||
|
Loading…
Reference in New Issue
Block a user