From 396daf31cb0dd4a964ccc784f9715e80381138cf Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 24 May 2012 14:45:08 +0000 Subject: Fix #99. Account for empty header IDs when ensuring uniqueness. --- markdown/extensions/headerid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3