From bbb5c60bfd6b09cffe0406a56930105335f07887 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sun, 25 Aug 2024 17:28:50 +0200 Subject: Improve NCX TOC rendering performance again --- nov.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nov.el') 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 "\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 "%s" -- cgit v1.2.3