Skip to content

Commit

Permalink
Removed some Py2.4-2.6 specific code.
Browse files Browse the repository at this point in the history
  • Loading branch information
waylan committed Jan 12, 2018
1 parent 1127013 commit d4de20b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
8 changes: 1 addition & 7 deletions markdown/extensions/attr_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
from ..util import isBlockLevel
import re

try:
Scanner = re.Scanner
except AttributeError: # pragma: no cover
# must be on Python 2.4
from sre import Scanner


def _handle_double_quote(s, t):
k, v = t.split('=', 1)
Expand All @@ -53,7 +47,7 @@ def _handle_word(s, t):
return t, t


_scanner = Scanner([
_scanner = re.Scanner([
(r'[^ =]+=".*?"', _handle_double_quote),
(r"[^ =]+='.*?'", _handle_single_quote),
(r'[^ =]+=[^ =]+', _handle_key_value),
Expand Down
15 changes: 1 addition & 14 deletions markdown/inlinepatterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,6 @@ def unescape(self, text):
except KeyError: # pragma: no cover
return text

def itertext(el): # pragma: no cover
' Reimplement Element.itertext for older python versions '
tag = el.tag
if not isinstance(tag, util.string_type) and tag is not None:
return
if el.text:
yield el.text
for e in el:
for s in itertext(e):
yield s
if e.tail:
yield e.tail

def get_stash(m):
id = m.group(1)
if id in stash:
Expand All @@ -250,7 +237,7 @@ def get_stash(m):
return value
else:
# An etree Element - return text content only
return ''.join(itertext(value))
return ''.join(value.itertext())
return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)


Expand Down

0 comments on commit d4de20b

Please sign in to comment.