emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ox.el: Fix extra character deleted in org-export--update-included-link
@ 2019-11-03 13:14 Christoffer Stjernlöf
  2020-02-11 15:55 ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Christoffer Stjernlöf @ 2019-11-03 13:14 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

* 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-13 19:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-03 13:14 [PATCH] ox.el: Fix extra character deleted in org-export--update-included-link Christoffer Stjernlöf
2020-02-11 15:55 ` Bastien
2020-02-11 18:15   ` Nicolas Goaziou
2020-02-13  8:12     ` Bastien
2020-02-13 10:25       ` Nicolas Goaziou
2020-02-13 11:01         ` Bastien
2020-02-13 19:07           ` Adam Porter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).