Footnotes: Avoid matches in links.

Reported by Ian Barton.
This commit is contained in:
Carsten Dominik 2009-01-19 16:15:12 +01:00
parent bc530157aa
commit 0405dde8ef
3 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,10 @@
2009-01-19 Carsten Dominik <carsten.dominik@gmail.com> 2009-01-19 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-activate-footnote-links): Don't allow match inside a
link.
* org-footnote.el (org-footnote-re): Don't allow match inside a link.
* org-export-latex.el (org-export-latex-links): Keep a relative * org-export-latex.el (org-export-latex-links): Keep a relative
path relative also after export. path relative also after export.

View File

@ -47,7 +47,7 @@
(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading)) (declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
(defconst org-footnote-re (defconst org-footnote-re
(concat "." ; to make sure it is not at the beginning of a line (concat "[^][\n]" ; to make sure it is not at the beginning of a line
"\\[" "\\["
"\\(?:" "\\(?:"
"\\([0-9]+\\)" "\\([0-9]+\\)"

View File

@ -3785,15 +3785,15 @@ will be prompted for."
(defun org-activate-footnote-links (limit) (defun org-activate-footnote-links (limit)
"Run through the buffer and add overlays to links." "Run through the buffer and add overlays to links."
(if (re-search-forward "\\[\\([0-9]+\\]\\|fn:[^ \t\r\n:]+?[]:]\\)" (if (re-search-forward "\\(^\\|[^][]\\)\\(\\[\\([0-9]+\\]\\|fn:[^ \t\r\n:]+?[]:]\\)\\)"
limit t) limit t)
(progn (progn
(add-text-properties (match-beginning 0) (match-end 0) (add-text-properties (match-beginning 1) (match-end 1)
(list 'mouse-face 'highlight (list 'mouse-face 'highlight
'rear-nonsticky org-nonsticky-props 'rear-nonsticky org-nonsticky-props
'keymap org-mouse-map 'keymap org-mouse-map
'help-echo 'help-echo
(if (= (point-at-bol) (match-beginning 0)) (if (= (point-at-bol) (match-beginning 1))
"Footnote definition" "Footnote definition"
"Footnote reference") "Footnote reference")
)) ))