aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-05-24 14:45:08 +0000
committerWaylan Limberg <waylan@gmail.com>2012-05-24 14:45:08 +0000
commit396daf31cb0dd4a964ccc784f9715e80381138cf (patch)
tree9f958361b588300236e912c728bdf28c2007a43f
parent3ce80f612126621cecf641856efe42d650c90bf3 (diff)
downloadmarkdown-396daf31cb0dd4a964ccc784f9715e80381138cf.tar.gz
markdown-396daf31cb0dd4a964ccc784f9715e80381138cf.tar.bz2
markdown-396daf31cb0dd4a964ccc784f9715e80381138cf.zip
Fix #99. Account for empty header IDs when ensuring uniqueness.
-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)