mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
a2d58d639b
commit
bb3e2d6a29
@ -92,16 +92,14 @@ def element(elem_id, child_selector):
|
|||||||
ans = ans.querySelector(child_selector)
|
ans = ans.querySelector(child_selector)
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
auto_id_count = 0
|
|
||||||
|
|
||||||
def ensure_id(w):
|
def ensure_id(w):
|
||||||
nonlocal auto_id_count
|
|
||||||
ans = w.getAttribute('id')
|
ans = w.getAttribute('id')
|
||||||
if not ans:
|
if not ans:
|
||||||
auto_id_count += 1
|
ensure_id.count += 1
|
||||||
ans = 'auto-id-' + auto_id_count
|
ans = 'auto-id-' + ensure_id.count
|
||||||
w.setAttribute('id', ans)
|
w.setAttribute('id', ans)
|
||||||
return ans
|
return ans
|
||||||
|
ensure_id.count = 0
|
||||||
|
|
||||||
extra_css = v'[]'
|
extra_css = v'[]'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user