aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2020-07-09 19:39:34 +0530
committerArun Isaac2020-07-10 19:00:20 +0530
commit3a8697ef5f08dd5166bb26bfa1a4777cf69c06ff (patch)
tree11cb189c59fe3c66cbe12483ed0a4c91be3ccf69
parent50498af7355bd8b7801ec94cc208cef1ea681627 (diff)
downloadennum-3a8697ef5f08dd5166bb26bfa1a4777cf69c06ff.tar.gz
ennum-3a8697ef5f08dd5166bb26bfa1a4777cf69c06ff.tar.lz
ennum-3a8697ef5f08dd5166bb26bfa1a4777cf69c06ff.zip
Percent encode URIs.
* ennu-html.el (ennu-html-link, ennu-export-post, ennu-export-thumbnail, ennu-export-video, ennu-export-static, ennu-export-tag): Percent encode URIs.
-rw-r--r--ennu-html.el33
1 files changed, 19 insertions, 14 deletions
diff --git a/ennu-html.el b/ennu-html.el
index 1f76f23..10025bc 100644
--- a/ennu-html.el
+++ b/ennu-html.el
@@ -286,10 +286,11 @@
(org-html-link
(org-element-put-property
(org-element-put-property
- link :path (expand-file-name*
- (ennu-image-output-filename
- path (ennu-setting :default-image-width))
- (ennu-setting :images-directory)))
+ link :path (url-encode-url
+ (expand-file-name*
+ (ennu-image-output-filename
+ path (ennu-setting :default-image-width))
+ (ennu-setting :images-directory))))
:type "file")
desc info))))
;; Pass other link types to org-html-link
@@ -306,8 +307,8 @@
((or 'ennu-html 'html)
(let ((filename (concat (expand-file-name path (ennu-setting :posts-directory))
".org")))
- (xmlgen `(a :href ,(expand-file-name*
- path (ennu-setting :posts-directory))
+ (xmlgen `(a :href ,(url-encode-url
+ (expand-file-name* path (ennu-setting :posts-directory)))
,(or desc (ennu-post-title (ennu-read-post filename)))))))))
(defun ennu-follow-post (path)
@@ -329,10 +330,11 @@
(pcase backend
((or 'ennu-html 'html)
(xmlgen
- `(img :src ,(expand-file-name*
- (ennu-image-output-filename
- path (ennu-setting :thumbnail-image-width))
- (ennu-setting :images-directory)))))))
+ `(img :src ,(url-encode-url
+ (expand-file-name*
+ (ennu-image-output-filename
+ path (ennu-setting :thumbnail-image-width))
+ (ennu-setting :images-directory))))))))
(org-link-set-parameters
"thumbnail"
@@ -344,8 +346,9 @@
((or 'ennu-html 'html)
(let ((video-directory (ennu-setting :video-directory)))
(xmlgen
- `(video :src ,(expand-file-name* path video-directory)
- :poster ,(expand-file-name* (ennu-video-poster path) video-directory)
+ `(video :src ,(url-encode-url (expand-file-name* path video-directory))
+ :poster ,(url-encode-url
+ (expand-file-name* (ennu-video-poster path) video-directory))
:preload "none"
:controls ""))))))
@@ -356,7 +359,8 @@
(pcase backend
((or 'ennu-html 'html)
(xmlgen
- `(a :href ,(expand-file-name* path (ennu-setting :static-directory))
+ `(a :href ,(url-encode-url
+ (expand-file-name* path (ennu-setting :static-directory)))
,desc)))))
(org-link-set-parameters
@@ -369,7 +373,8 @@
(pcase backend
((or 'ennu-html 'html)
(xmlgen
- `(a :href ,(expand-file-name* tag (ennu-setting :tag-directory))
+ `(a :href ,(url-encode-url
+ (expand-file-name* tag (ennu-setting :tag-directory)))
,(or desc tag))))))
(org-link-set-parameters