Browse Source

Export: Respect the description in a coderef

Shaun Johanson writes:

> Consider the following Org file:
>
>   * Test
>
>    See [[(foo)][FOOBIE]]
>
>    #+BEGIN_EXAMPLE
>    <foo>: blah blah       (ref:foo)
>    #+END_EXAMPLE
>
> Question 1)
>  In Org mode the link displays as FOOBIE, in the exported HTML it
>  displays as (foo). Is there any way to cause the link to use the
>  description (FOOBIE) in HTML? If not would this be a useful option
>  to add?

This was a bug, fixed now.
Carsten Dominik 16 years ago
parent
commit
a01ae6ee38
3 changed files with 4 additions and 2 deletions
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-exp.el
  3. 0 1
      lisp/org-html.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-05-06  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-export-get-coderef-format): Use the description
+	is present.
+
 	* org.el (org-sort-entries-or-items): Improve docstring, and make
 	better implementation for time sorting.
 

+ 1 - 1
lisp/org-exp.el

@@ -2576,7 +2576,7 @@ stacked delimiters is N.  Escaping delimiters is not possible."
 		   (regexp-quote (concat "(" path ")"))
 		   desc))
 	(replace-match "%s" t t desc)
-      "%s")))
+      (or desc "%s"))))
 
 (provide 'org-exp)
 

+ 0 - 1
lisp/org-html.el

@@ -965,7 +965,6 @@ lang=\"%s\" xml:lang=\"%s\">
 				"</a>")))
 
 	     ((string= type "coderef")
-
 	      (setq rpl (format "<a href=\"#coderef-%s\" class=\"coderef\" onmouseover=\"CodeHighlightOn(this, 'coderef-%s');\" onmouseout=\"CodeHighlightOff(this, 'coderef-%s');\">%s</a>"
 				path path path
 				(format (org-export-get-coderef-format path (and descp desc))