aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/extensions/attr_list.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py
index 2175691..fabc925 100644
--- a/markdown/extensions/attr_list.py
+++ b/markdown/extensions/attr_list.py
@@ -97,7 +97,7 @@ class AttrListTreeprocessor(Treeprocessor):
if m:
self.assign_attrs(elem, m.group(1))
elem[-1].tail = elem[-1].tail[:m.start()]
- elif pos > 0 and elem[pos-1].tail:
+ elif pos is not None and pos > 0 and elem[pos-1].tail:
# use tail of last child before ul or ol
m = RE.search(elem[pos-1].tail)
if m: