org-download

a fork of abo-abo's org-download
git clone https://git.trogloxene.org/org-download.git
Log | Files | Refs | README

commit 055c92e56ac156dddd3185fd7d088d8b5a27e7d2
parent 992342fa5ec6b1ae649328d6498aac2bdd5de9a6
Author: Oleh Krehel <ohwoeowho@gmail.com>
Date:   Thu,  4 Apr 2019 15:05:40 +0200

org-download.el (org-download-get-heading): Replace spaces in headings

Fixes #83

Diffstat:
Morg-download.el | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/org-download.el b/org-download.el @@ -172,7 +172,9 @@ will be used." (progn (unless (= cur-lvl 1) (org-up-heading-all (- (1- (org-current-level)) lvl))) - (nth 4 (org-heading-components))) + (replace-regexp-in-string + " " "_" + (nth 4 (org-heading-components)))) "")))) (defun org-download--dir-1 () @@ -184,9 +186,9 @@ It's `org-download-image-dir', unless it's nil. Then it's \".\"." "Return the second part of the directory path for `org-download--dir'. Unless `org-download-heading-lvl' is nil, it's the name of the current `org-download-heading-lvl'-leveled heading. Otherwise it's \"\"." - (and org-download-heading-lvl - (org-download-get-heading - org-download-heading-lvl))) + (when org-download-heading-lvl + (org-download-get-heading + org-download-heading-lvl))) (defun org-download--dir () "Return the directory path for image storage.