Skip to content

Commit

Permalink
Fix #99. Account for empty header IDs when ensuring uniqueness.
Browse files Browse the repository at this point in the history
  • Loading branch information
Waylan Limberg committed May 24, 2012
1 parent 3ce80f6 commit 396daf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion markdown/extensions/headerid.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def slugify(value, separator):

def unique(id, ids):
""" Ensure id is unique in set of ids. Append '_1', '_2'... if not """
while id in ids:
while id in ids or not id:
m = IDCOUNT_RE.match(id)
if m:
id = '%s_%d'% (m.group(1), int(m.group(2))+1)
Expand Down

0 comments on commit 396daf3

Please sign in to comment.