mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: Insert hyperlinks: When sorting anchors on elements without any text content, use the anchor itself
This commit is contained in:
parent
7b64f8a396
commit
4a5e505ccf
@ -733,9 +733,9 @@ class InsertLink(Dialog):
|
|||||||
frag = item.get('id', None) or item.get('name')
|
frag = item.get('id', None) or item.get('name')
|
||||||
if not frag:
|
if not frag:
|
||||||
continue
|
continue
|
||||||
text = lead_text(item, num_words=4)
|
text = lead_text(item, num_words=4).strip()
|
||||||
ac.append((text, frag))
|
ac.append((text, frag))
|
||||||
ac.sort(key=lambda text_frag: numeric_sort_key(text_frag[0]))
|
ac.sort(key=lambda text_frag: numeric_sort_key(text_frag[0] or text_frag[1]))
|
||||||
self.anchor_names.model().set_names(self.anchor_cache[name])
|
self.anchor_names.model().set_names(self.anchor_cache[name])
|
||||||
self.update_target()
|
self.update_target()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user