Skip to content

Commit

Permalink
wikipedia: Fix special characters in urls
Browse files Browse the repository at this point in the history
Thanks to @Tomin1 for the solution. Closes sopel-irc#724
  • Loading branch information
embolalia committed Feb 15, 2015
1 parent 3689916 commit 9278810
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion wikipedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
import json
import re

import sys
if sys.version_info.major < 3:
from urlparse import unquote
else:
from urllib.parse import unquote

REDIRECT = re.compile(r'^REDIRECT (.*)')


Expand Down Expand Up @@ -90,7 +96,7 @@ def mw_info(bot, trigger, found_match=None):
server.
"""
match = found_match or trigger
say_snippet(bot, match.group(1), match.group(2), show_url=False)
say_snippet(bot, match.group(1), unquote(match.group(2)), show_url=False)


@commands('w', 'wiki', 'wik')
Expand Down

0 comments on commit 9278810

Please sign in to comment.