emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Re: [BUG] OrgTbl exports raw ampersands in HTML


From: Carsten Dominik
Subject: Re: [Orgmode] Re: [BUG] OrgTbl exports raw ampersands in HTML
Date: Fri, 15 Oct 2010 08:24:42 +0200


On Oct 13, 2010, at 10:52 PM, Nick Dokos wrote:

Ivan Vilata i Balaguer <address@hidden> wrote:

Nick Dokos (2010-10-13 21:10:33 +0200) wrote:

Yes, thanks. I'll try it out later. FWIW, my mail reader does not see
an attachment in your message: all I get is the following attachmen
with an external body. Not sure whose fault that is though: maybe mh-e
gets hopelessly confused with it. Can you post the HTML file inline?

Argh, I made an external attachment, sorry.  Here you have the file:

----8<----
<html>
 <body>
<!-- [CDATA[
#+ORGTBL: SEND test orgtbl-to-html
| foo&bar |
]] -->
<!-- BEGIN RECEIVE ORGTBL test -->
<!-- END RECEIVE ORGTBL test -->
 </body>
</html>
----8<----


The following patch should fix it:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 3fd7b72..f7824ce 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1885,7 +1885,7 @@ lang=\"%s\" xml:lang=\"%s\">
              ;; ignore this line
              (throw 'next-line t)))
        ;; Break the line into fields
-       (setq fields (org-split-string line "[ \t]*|[ \t]*"))
+ (setq fields (mapcar (function org-html-expand) (org-split-string line "[ \t]*|[ \t]*")))
        (unless fnum (setq fnum (make-vector (length fields) 0)
                           nfields (length fnum)))
        (setq nline (1+ nline) i -1
--8<---------------cut here---------------end--------------->8---

Hi Nick, this is the right medicine, in the wrong place.
It needs to be done in orgtbl-to-html.  The function
where you inserted the call to org-html-expand is also
used by the general html exporter, and during normal
html export, org-html-expand is already called at an
earlier stage.

Anyway, thanks a lot for doing 90% of the work!

- Carsten



reply via email to

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