aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/extensions/headerid.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/extensions/headerid.py b/markdown/extensions/headerid.py
index b0e37e2..c99c4bd 100644
--- a/markdown/extensions/headerid.py
+++ b/markdown/extensions/headerid.py
@@ -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)