1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2025-01-05 11:45:52 +00:00

HTML export: Protect explicit target links

If a link is [[#name][desc]], the href wil be exacty href="#name".
So starting a link target with # will indicate that there will be an
explicit target for this.
This commit is contained in:
Carsten Dominik 2009-03-12 11:38:44 +01:00
parent b0416ae0a9
commit 80ec053008
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2009-03-12 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export-target-internal-links)
(org-export-as-html): Protect links specified as #name.
2009-03-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-clone-subtree-with-time-shift): New command.

View File

@ -1794,6 +1794,9 @@ the current file."
found props pos cref
(target
(cond
((= (string-to-char link) ?#)
;; user wants exactly this link
link)
((cdr (assoc slink target-alist)))
((and (string-match "^id:" link)
(cdr (assoc (substring link 3) target-alist))))
@ -3789,7 +3792,8 @@ lang=\"%s\" xml:lang=\"%s\">
((equal type "internal")
(setq rpl
(concat
"<a href=\"#"
"<a href=\""
(if (= (string-to-char path) ?#) "" "#")
(org-solidify-link-text
(save-match-data (org-link-unescape path)) nil)
"\"" attr ">"