diff options
author | Vasilij Schneidermann <mail@vasilij.de> | 2020-05-04 11:35:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 11:35:59 +0200 |
commit | 324c0ca8bf3f48bd2909655112203c75bb37c0a3 (patch) | |
tree | 15abf213e6b66608df61775a1ad9dc3025d750c1 | |
parent | 03776c62c995682455267851617461c1ecf3217b (diff) | |
parent | ae0f48672efc07631a6b26ab53ef8df358530530 (diff) |
Merge pull request #71 from clemera/fix-link-label-parsing-for-imenu
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)))) |