Skip to content

Commit 4cbf0d5

Browse files
committed
addition by subtraction.
1 parent 35f32c2 commit 4cbf0d5

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

tests/test_github_issues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ def test_github_issue_30():
8989
def test_github_issue_36():
9090
text = '"Chögyam Trungpa":https://www.google.com/search?q=Chögyam+Trungpa'
9191
result = textile.textile(text)
92-
expect = '\t<p><a href="https://www.google.com/search?q=Ch%C3%B6gyam%2BTrungpa">Chögyam Trungpa</a></p>'
92+
expect = '\t<p><a href="https://www.google.com/search?q=Chögyam+Trungpa">Chögyam Trungpa</a></p>'
9393
assert result == expect

textile/core.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,6 @@ def encode_url(self, url):
938938
quote(unquote(pce).encode('utf8'), b'')
939939
for pce in parsed.path.split('/')
940940
)
941-
query_text = parsed.query
942-
if six.PY2:
943-
query_text = query_text.encode('utf-8')
944-
query = quote(unquote(query_text), b'=&?/')
945941
fragment = quote(unquote(parsed.fragment))
946942

947943
# put it back together
@@ -954,7 +950,7 @@ def encode_url(self, url):
954950
netloc = '{0}{1}'.format(netloc, host)
955951
if port:
956952
netloc = '{0}:{1}'.format(netloc, port)
957-
return urlunsplit((scheme, netloc, path, query, fragment))
953+
return urlunsplit((scheme, netloc, path, parsed.query, fragment))
958954

959955
def span(self, text):
960956
qtags = (r'\*\*', r'\*', r'\?\?', r'\-', r'__',

0 commit comments

Comments
 (0)