emacs-orgmode
[Top][All Lists]
Advanced

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

[PATCH] ox.el: Fix extra character deleted in org-export--update-include


From: Christoffer Stjernlöf
Subject: [PATCH] ox.el: Fix extra character deleted in org-export--update-included-link
Date: Sun, 03 Nov 2019 14:14:35 +0100

* ox.el (org-export--update-included-link): Fix bug.
(org-export--update-included-link): Delete region only until one less
than (org-element-property :end link).

The old behaviour meant that e.g. the following headline could fail to
parse correctly after inclusion:

[[file:something.org][Title]] :tags:following:immediately

because it would be converted to

[[file:path/to/something.org][Title]]:tags:following:immediately
where the whitespace was necessary for Org to understand that the tags
indeed were tags.

TINYCHANGE
---
 lisp/ox.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index 5b4134ecc..6c1d1b455 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3468,7 +3468,7 @@ Move point after the link."
                            (org-element-property :contents-end link)))))
        (org-element-put-property new-link :path new-path)
        (delete-region (org-element-property :begin link)
-                      (org-element-property :end link))
+                      (1- (org-element-property :end link)))
        (insert (org-element-link-interpreter new-link contents))))))
 
 (defun org-export--prepare-file-contents
-- 

Attachment: signature.asc
Description: PGP signature


reply via email to

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