emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/markdown-mode 9a7c1da 2/4: Decode %20 in the local inline


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode 9a7c1da 2/4: Decode %20 in the local inline image file path
Date: Sat, 19 Dec 2020 21:57:09 -0500 (EST)

branch: elpa/markdown-mode
commit 9a7c1dad1e4d979135f99b9b372c14ed293e31f8
Author: Raphael Feng <raphael.feng@gmail.com>
Commit: Raphael Feng <raphael.feng@gmail.com>

    Decode %20 in the local inline image file path
---
 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]