aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/extensions/attr_list.py8
-rw-r--r--markdown/postprocessors.py2
2 files changed, 8 insertions, 2 deletions
diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py
index 7a4014f..60287fe 100644
--- a/markdown/extensions/attr_list.py
+++ b/markdown/extensions/attr_list.py
@@ -22,6 +22,12 @@ import markdown
import re
from markdown.util import isBlockLevel
+try:
+ Scanner = re.Scanner
+except AttributeError:
+ # must be on Python 2.4
+ from sre import Scanner
+
def _handle_double_quote(s, t):
k, v = t.split('=')
return k, v.strip('"')
@@ -40,7 +46,7 @@ def _handle_word(s, t):
return u'id', t[1:]
return t, t
-_scanner = re.Scanner([
+_scanner = Scanner([
(r'[^ ]+=".*?"', _handle_double_quote),
(r"[^ ]+='.*?'", _handle_single_quote),
(r'[^ ]+=[^ ]*', _handle_key_value),
diff --git a/markdown/postprocessors.py b/markdown/postprocessors.py
index 8985fb8..b646027 100644
--- a/markdown/postprocessors.py
+++ b/markdown/postprocessors.py
@@ -82,7 +82,7 @@ class RawHtmlPostprocessor(Postprocessor):
def isblocklevel(self, html):
m = re.match(r'^\<\/?([^ ]+)', html)
if m:
- if m.group(1).startswith(('!', '?', '@', '%')):
+ if m.group(1)[0] in ('!', '?', '@', '%'):
# Comment, php etc...
return True
return util.isBlockLevel(m.group(1))