1. ms2ger
  2. Anolis


Geoffrey Sneddon  committed f6b1efb

Fix case when empty @id could be created.

  • Participants
  • Parent commits b5af9cd
  • Branches default

Comments (0)

Files changed (3)

File anolislib/utils.py

View file
  • Ignore whitespace
             source = u"generatedID"
         source = non_ifragment.sub(u"-", source).strip(u"-")
+        if source == u"":
+            source = u"generatedID"
     # Initally set the id to the source
     id = source

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

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

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

View file
  • Ignore whitespace
+<!doctype html>