Skip to content

Commit 93f5382

Browse files
committed
self.shelve to the rescue?
1 parent aa4d643 commit 93f5382

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

textile/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,7 @@ def _casesdefault(c, pop, popped, url_chars, counts, pre):
874874
url = self.shelveURL(self.encode_url(urlunsplit(uri_parts)))
875875
attributes = parse_attributes(atts)
876876
if title:
877-
title = six.text_type(title)
878-
attributes['title'] = title
877+
attributes['title'] = self.shelve(title)
879878
attributes['href'] = url
880879
if self.rel:
881880
attributes['rel'] = self.rel

textile/utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def generate_tag(tag, content, attributes=None):
5353
enc = 'unicode'
5454
if six.PY2:
5555
enc = 'UTF-8'
56-
attributes = OrderedDict((k, six.text_type(v)) for k, v in attributes.items())
5756
if not tag:
5857
return content
5958
element = ElementTree.Element(tag, attrib=attributes)
@@ -64,8 +63,6 @@ def generate_tag(tag, content, attributes=None):
6463
try:
6564
element_tag = ElementTree.tostringlist(element, encoding=enc,
6665
method='html')
67-
if six.PY2:
68-
element_tag = [v.decode('utf8') for v in element_tag]
6966
element_tag.insert(len(element_tag) - 1, content)
7067
element_text = ''.join(element_tag)
7168
except AttributeError:

0 commit comments

Comments
 (0)