mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-27 07:32:52 +00:00
Fix plain link export
This commit is contained in:
parent
0db9bf496c
commit
0b0460703a
|
@ -1,5 +1,9 @@
|
||||||
2009-08-24 Carsten Dominik <carsten.dominik@gmail.com>
|
2009-08-24 Carsten Dominik <carsten.dominik@gmail.com>
|
||||||
|
|
||||||
|
* org-exp.el (org-export-protect-sub-super): New function.
|
||||||
|
(org-export-normalize-links): Protect the url of plain links from
|
||||||
|
supscript and superscript processing.
|
||||||
|
|
||||||
* org-remember.el (org-remember-escaped-%): New function.
|
* org-remember.el (org-remember-escaped-%): New function.
|
||||||
(org-remember-apply-template): Use `org-remember-escaped-%' to
|
(org-remember-apply-template): Use `org-remember-escaped-%' to
|
||||||
detect escaped % signs.
|
detect escaped % signs.
|
||||||
|
|
|
@ -1846,6 +1846,12 @@ When it is nil, all comments will be removed."
|
||||||
(point-at-eol))
|
(point-at-eol))
|
||||||
(end-of-line 1))))
|
(end-of-line 1))))
|
||||||
|
|
||||||
|
(defun org-export-protect-sub-super (s)
|
||||||
|
(save-match-data
|
||||||
|
(while (string-match "\\([^\\\\]\\)\\([_^]\\)" s)
|
||||||
|
(setq s (replace-match "\\1\\\\\\2" nil nil s)))
|
||||||
|
s))
|
||||||
|
|
||||||
(defun org-export-normalize-links ()
|
(defun org-export-normalize-links ()
|
||||||
"Convert all links to bracket links, and expand link abbreviations."
|
"Convert all links to bracket links, and expand link abbreviations."
|
||||||
(let ((re-plain-link (concat "\\([^[<]\\)" org-plain-link-re))
|
(let ((re-plain-link (concat "\\([^[<]\\)" org-plain-link-re))
|
||||||
|
@ -1855,8 +1861,11 @@ When it is nil, all comments will be removed."
|
||||||
(while (re-search-forward re-plain-link nil t)
|
(while (re-search-forward re-plain-link nil t)
|
||||||
(goto-char (1- (match-end 0)))
|
(goto-char (1- (match-end 0)))
|
||||||
(org-if-unprotected-at (1+ (match-beginning 0))
|
(org-if-unprotected-at (1+ (match-beginning 0))
|
||||||
(let* ((s (concat (match-string 1) "[[" (match-string 2)
|
(let* ((s (concat (match-string 1)
|
||||||
":" (match-string 3) "]]")))
|
"[[" (match-string 2) ":" (match-string 3)
|
||||||
|
"][" (match-string 2) ":" (org-export-protect-sub-super
|
||||||
|
(match-string 3))
|
||||||
|
"]]")))
|
||||||
;; added 'org-link face to links
|
;; added 'org-link face to links
|
||||||
(put-text-property 0 (length s) 'face 'org-link s)
|
(put-text-property 0 (length s) 'face 'org-link s)
|
||||||
(replace-match s t t))))
|
(replace-match s t t))))
|
||||||
|
@ -1864,8 +1873,11 @@ When it is nil, all comments will be removed."
|
||||||
(while (re-search-forward re-angle-link nil t)
|
(while (re-search-forward re-angle-link nil t)
|
||||||
(goto-char (1- (match-end 0)))
|
(goto-char (1- (match-end 0)))
|
||||||
(org-if-unprotected
|
(org-if-unprotected
|
||||||
(let* ((s (concat (match-string 1) "[[" (match-string 2)
|
(let* ((s (concat (match-string 1)
|
||||||
":" (match-string 3) "]]")))
|
"[[" (match-string 2) ":" (match-string 3)
|
||||||
|
"][" (match-string 2) ":" (org-export-protect-sub-super
|
||||||
|
)(match-string 3)
|
||||||
|
"]]")))
|
||||||
(put-text-property 0 (length s) 'face 'org-link s)
|
(put-text-property 0 (length s) 'face 'org-link s)
|
||||||
(replace-match s t t))))
|
(replace-match s t t))))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
|
|
Loading…
Reference in a new issue