aboutsummaryrefslogtreecommitdiff
path: root/nov.el
diff options
context:
space:
mode:
authorVasilij Schneidermann <mail@vasilij.de>2024-08-25 17:28:50 +0200
committerVasilij Schneidermann <mail@vasilij.de>2024-08-25 17:28:50 +0200
commitbbb5c60bfd6b09cffe0406a56930105335f07887 (patch)
treeef75e1b364c0ed58f9a096ee79a680c1cae69bd4 /nov.el
parent13ba2fe401c1ebc786317e5eca3cc06bddbf8cbd (diff)
Improve NCX TOC rendering performance again
Diffstat (limited to 'nov.el')
-rw-r--r--nov.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/nov.el b/nov.el
index 7476b7e..739a930 100644
--- a/nov.el
+++ b/nov.el
@@ -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>"