aboutsummaryrefslogtreecommitdiff
path: root/nov.el
diff options
context:
space:
mode:
authorVasilij Schneidermann <mail@vasilij.de>2017-08-30 22:44:05 +0200
committerVasilij Schneidermann <mail@vasilij.de>2017-08-30 22:44:05 +0200
commit5747b9eb6ebfca4f603ed0401817132892b4b9dc (patch)
tree79f0a097860adbd16a518bc1f88ccb2b914c3e5e /nov.el
parent4406b0a998623f7077db699aa51663e60394e222 (diff)
Strip directories in hyperlink targets
Diffstat (limited to 'nov.el')
-rw-r--r--nov.el5
1 files changed, 4 insertions, 1 deletions
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.