diff options
author | David Maus <dmaus@ictsoc.de> | 2010-10-22 06:22:41 +0200 |
---|---|---|
committer | David Maus <dmaus@ictsoc.de> | 2010-10-22 06:22:41 +0200 |
commit | 8d85a67deba113adeb262b09c03f88cbe4d572fa (patch) | |
tree | b16274637cef60d0549e893639329e5726114536 | |
parent | d8634bab85c920db2cc414bf535fdf298b73a591 (diff) | |
download | org-mode-8d85a67deba113adeb262b09c03f88cbe4d572fa.tar.gz |
Skip normalization of plain links that are part of another link
* org-exp.el (org-export-normalize-links): Skip normalization of plain
links that are part of another link.
-rw-r--r-- | lisp/org-exp.el | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 6ee56a8..d2d2744 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1831,16 +1831,19 @@ Also, store forcedalignment information found in such lines." nodesc) (goto-char (point-min)) (while (re-search-forward re-plain-link nil t) - (goto-char (1- (match-end 0))) - (org-if-unprotected-at (1+ (match-beginning 0)) - (let* ((s (concat (match-string 1) - "[[" (match-string 2) ":" (match-string 3) - "][" (match-string 2) ":" (org-export-protect-sub-super - (match-string 3)) - "]]"))) - ;; added 'org-link face to links - (put-text-property 0 (length s) 'face 'org-link s) - (replace-match s t t)))) + (unless (org-string-match-p + "\\[\\[\\S+:\\S-*?\\<" + (buffer-substring (point-at-bol) (match-beginning 0))) + (goto-char (1- (match-end 0))) + (org-if-unprotected-at (1+ (match-beginning 0)) + (let* ((s (concat (match-string 1) + "[[" (match-string 2) ":" (match-string 3) + "][" (match-string 2) ":" (org-export-protect-sub-super + (match-string 3)) + "]]"))) + ;; added 'org-link face to links + (put-text-property 0 (length s) 'face 'org-link s) + (replace-match s t t))))) (goto-char (point-min)) (while (re-search-forward re-angle-link nil t) (goto-char (1- (match-end 0))) |