Browse Source

ox-org: Allow custom export for links

* lisp/ox-org.el (org-org-link): New function.

This patch allows to handle `org' export format in EXPORT argument
from `org-add-link-type'.

Suggested-by: John Kitchin <johnrkitchin@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94439>
Nicolas Goaziou 10 years ago
parent
commit
f7a1e23d20
1 changed files with 8 additions and 1 deletions
  1. 8 1
      lisp/ox-org.el

+ 8 - 1
lisp/ox-org.el

@@ -78,7 +78,7 @@ setting of `org-html-htmlize-output-type' is 'css."
     (latex-environment . org-org-identity)
     (latex-fragment . org-org-identity)
     (line-break . org-org-identity)
-    (link . org-org-identity)
+    (link . org-org-link)
     (node-property . org-org-identity)
     (template . org-org-template)
     (paragraph . org-org-identity)
@@ -142,6 +142,13 @@ CONTENTS is nil.  INFO is ignored."
 		      "OPTIONS" "TITLE"))
       (org-element-keyword-interpreter keyword nil))))
 
+(defun org-org-link (link contents info)
+  "Transcode LINK object back into Org syntax.
+CONTENTS is the description of the link, as a string, or nil.
+INFO is a plist containing current export state."
+  (or (org-export-custom-protocol-maybe link contents info)
+      (org-element-link-interpreter link contents)))
+
 (defun org-org-template (contents info)
   "Return Org document template with document keywords.
 CONTENTS is the transcoded contents string.  INFO is a plist used