diff options
author | Clemens Radermacher <clemera@posteo.net> | 2020-05-04 09:13:31 +0200 |
---|---|---|
committer | Clemens Radermacher <clemera@posteo.net> | 2020-05-04 11:32:45 +0200 |
commit | ae0f48672efc07631a6b26ab53ef8df358530530 (patch) | |
tree | 15abf213e6b66608df61775a1ad9dc3025d750c1 | |
parent | 03776c62c995682455267851617461c1ecf3217b (diff) |
Fix link label parsing for imenu
-rw-r--r-- | nov.el | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -867,6 +867,7 @@ See also `nov-bookmark-make-record'." (defun nov-imenu-create-index () "Generate Imenu index." + (require 'esxml) (let* ((toc-path (cdr (aref nov-documents 0))) (ncxp (version< nov-epub-version "3.0")) (toc (with-temp-buffer @@ -877,7 +878,8 @@ See also `nov-bookmark-make-record'." (mapcar (lambda (node) (-let* ((href (esxml-node-attribute 'href node)) - (label (car (esxml-node-children node))) + (label (mapconcat 'string-trim-whitespace + (esxml-find-descendants #'stringp node) " ")) ((filename target) (nov-url-filename-and-target href))) (list label filename 'nov-imenu-goto-function target))) (esxml-query-all "a" toc)))) |