Skip to content

Commit

Permalink
drop more py26 code and don't revert the fix for #30.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikirudennis committed Jul 11, 2016
1 parent d1aa498 commit 5fb0cdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions textile/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@
from textile.objects import Block, Table


try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from collections import OrderedDict

from six.moves import urllib
urlparse, urlsplit, urlunsplit, quote, unquote = (urllib.parse.urlparse,
Expand Down
9 changes: 3 additions & 6 deletions textile/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
urlparse = urllib.parse.urlparse
HTMLParser = html_parser.HTMLParser

try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from collections import OrderedDict

from xml.etree import ElementTree

Expand Down Expand Up @@ -60,8 +57,8 @@ def generate_tag(tag, content, attributes=None):
# adding text by assigning it to element_tag.text. That results in
# non-ascii text being html-entity encoded. Not bad, but not entirely
# matching php-textile either.
element_tag = ElementTree.tostringlist(element, encoding=enc,
method='html')
element_tag = [v.decode(enc) for v in ElementTree.tostringlist(element, encoding=enc,
method='html')]
element_tag.insert(len(element_tag) - 1, content)
element_text = ''.join(element_tag)
return element_text
Expand Down

0 comments on commit 5fb0cdd

Please sign in to comment.