emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [ODT] [BUG?] Custom links are formatted as for html


From: Christian Moe
Subject: [O] [ODT] [BUG?] Custom links are formatted as for html
Date: Sat, 12 Nov 2011 20:33:29 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0

Hi, Jambunathan,

When I try to define a custom link type with special formatting for ODT export, the exporter behaves as if the backend is html.

I'll exemplify with a tweaked version of org-bbdb-export, since that's the textbook example of a custom link. I've rewritten it below so that if the export FORMAT is 'odt, BBDB links should be in bold.

(defun org-bbdb-export (path desc format)
  "Create the export version of a BBDB link specified by PATH or DESC.
If exporting to either HTML or LaTeX FORMAT the link will be
italicized, in ODT it's bold, in all other cases it is left unchanged."
  (when (string= desc (format "bbdb:%s" path))
    (setq desc path))
  (cond
   ((eq format 'html) (format "<i>%s</i>" desc))
   ((eq format 'latex) (format "\\textit{%s}" desc))
((eq format 'odt) (format "<text:span text:style-name=\"Bold\">%s</text:span>" desc))
   (t desc)))

Now, when I export this:

   Here's my own address (bbdb:Moe).

...the ODT document does not contain the expected:

Here's my own address (<text:span text:style-name=\"Bold\">Moe</text:span>).

...instead, it contains the formatting intended for HTML:

   Here's my own address (<i>Moe</i>).

...which, of course, displays as:

   Here's my own address ().


Yours,
Christian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]