From 5747b9eb6ebfca4f603ed0401817132892b4b9dc Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Wed, 30 Aug 2017 22:44:05 +0200 Subject: Strip directories in hyperlink targets --- nov.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nov.el b/nov.el index af20042..ee3b7b1 100644 --- a/nov.el +++ b/nov.el @@ -335,7 +335,10 @@ Each alist item consists of the identifier and full path.") (defun nov-url-filename-and-target (url) "Return a list of URL's filename and target." (setq url (url-generic-parse-url url)) - (list (url-filename url) (url-target url))) + ;; HACK: in case a directory is stripped, filenames may end up less + ;; than unique + (list (file-name-nondirectory (url-filename url)) + (url-target url))) (defun nov-insert-image (path) "Insert an image for PATH at point. -- cgit v1.2.3