[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/markdown-mode cc0c146 3/4: Merge pull request #575 from ra
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/markdown-mode cc0c146 3/4: Merge pull request #575 from raphaelfeng/master |
Date: |
Sat, 19 Dec 2020 21:57:10 -0500 (EST) |
branch: elpa/markdown-mode
commit cc0c1468a3a0fcc8962323873416380db717dbe9
Merge: 4d7f525 9a7c1da
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #575 from raphaelfeng/master
Support to display local inline images with spaces in file path encoded as
%20
---
markdown-mode.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/markdown-mode.el b/markdown-mode.el
index 2e47247..258376e 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -8398,13 +8398,14 @@ or \\[markdown-toggle-inline-images]."
(widen)
(goto-char (point-min))
(while (re-search-forward markdown-regex-link-inline nil t)
- (let ((start (match-beginning 0))
+ (let* ((start (match-beginning 0))
(imagep (match-beginning 1))
(end (match-end 0))
- (file (match-string-no-properties 6)))
+ (file (match-string-no-properties 6))
+ (unhex_file (url-unhex-string file)))
(when (and imagep
(not (zerop (length file))))
- (unless (file-exists-p file)
+ (unless (file-exists-p unhex_file)
(let* ((download-file (funcall
markdown-translate-filename-function file))
(valid-url (ignore-errors
(member (downcase (url-type
(url-generic-parse-url download-file)))
@@ -8414,10 +8415,10 @@ or \\[markdown-toggle-inline-images]."
(when (not valid-url)
;; strip query parameter
(setq file (replace-regexp-in-string "?.+\\'" "" file))))))
- (when (file-exists-p file)
- (let* ((abspath (if (file-name-absolute-p file)
- file
- (concat default-directory file)))
+ (when (file-exists-p unhex_file)
+ (let* ((abspath (if (file-name-absolute-p unhex_file)
+ unhex_file
+ (concat default-directory unhex_file)))
(image
(if (and markdown-max-image-size
(image-type-available-p 'imagemagick))