diff options
author | Vasilij Schneidermann <mail@vasilij.de> | 2024-08-25 17:28:50 +0200 |
---|---|---|
committer | Vasilij Schneidermann <mail@vasilij.de> | 2024-08-25 17:28:50 +0200 |
commit | bbb5c60bfd6b09cffe0406a56930105335f07887 (patch) | |
tree | ef75e1b364c0ed58f9a096ee79a680c1cae69bd4 | |
parent | 13ba2fe401c1ebc786317e5eca3cc06bddbf8cbd (diff) |
Improve NCX TOC rendering performance again
-rw-r--r-- | nov.el | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -399,10 +399,11 @@ Each alist item consists of the identifier and full path." (mapc (lambda (node) (nov--walk-ncx-node node)) children) (insert "</ol>\n")) ((eq tag 'navPoint) - (let* ((label-node (esxml-query "navLabel>text" node)) - (content-node (esxml-query "content" node)) + (let* ((navlabel-node (dom-by-tag node 'navLabel)) + (label-node (dom-by-tag navlabel-node 'text)) + (content-node (dom-by-tag node 'content)) (href (nov-urldecode (dom-attr content-node 'src))) - (label (car (dom-children label-node)))) + (label (and label-node (car (dom-children label-node))))) (when (not href) (error "Navigation point is missing href attribute")) (let ((link (format "<a href=\"%s\">%s</a>" |