summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-09-06 22:14:47 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-09-06 22:14:47 +0200
commit366dc4e369cab2009b55e2de81d9190871505d6e (patch)
treee54fa24e93a5724e1edb33eaaeaa400bd3fb43d6
parenta7394224aa640f1ab2d9ca213b2fc3a582bdc3ed (diff)
downloadorg-mode-366dc4e369cab2009b55e2de81d9190871505d6e.tar.gz
ox: Change internal tag for included footnotes
* lisp/ox.el (org-export--update-footnote-label): (org-export--prepare-file-contents): Use a new naming scheme for internal footnotes, less likely to introduce collisions. The previous one introduced a collision between [1] and [fn:1].
-rw-r--r--lisp/ox.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/ox.el b/lisp/ox.el
index 6dfed8d..c3b29b6 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3356,9 +3356,9 @@ Return the new label."
(goto-char (1+ ref-begin))
(buffer-substring (point)
(progn
- (if digit-label (insert (format "fn:%d-" id))
+ (if digit-label (insert (format "fn:--%d-" id))
(forward-char 3)
- (insert (format "%d-" id)))
+ (insert (format "-%d-" id)))
(1- (search-forward "]")))))
(defun org-export--prepare-file-contents
@@ -3463,8 +3463,8 @@ the included document."
;; the new label, which is only used for footnotes
;; outsides LINES.
(when label
- ;; If label is akin to [1] convert it to [fn:ID-1].
- ;; Otherwise add "ID-" after "fn:".
+ ;; If label is akin to [1] convert it to
+ ;; [fn:--ID-1]. Otherwise add "-ID-" after "fn:".
(let ((new-label (org-export--update-footnote-label
(org-element-property :begin reference)
digit-label id)))