Commits

Geoffrey Sneddon committed f6b1efb

Fix case when empty @id could be created.

Comments (0)

Files changed (3)

anolislib/utils.py

             source = u"generatedID"
     else:
         source = non_ifragment.sub(u"-", source).strip(u"-")
+        if source == u"":
+            source = u"generatedID"
 
     # Initally set the id to the source
     id = source

tests/basic/html5-id-hypen.html

+<!DOCTYPE html><head><meta charset=utf-8><h1>Foo</h1>
+<h2 id=generatedID><span class=secno>1 </span>-</h2>

tests/basic/html5-id-hypen.src.html

+<!doctype html>
+<h1>Foo</h1>
+<h2>-</h2>