From mboxrd@z Thu Jan 1 00:00:00 1970 From: niels giesen Subject: org-mode table with backslash inside fails to export to DocBook Date: Fri, 07 Jan 2011 11:03:32 +0100 Message-ID: <87aajdni8b.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1187996376==" Return-path: Received: from [140.186.70.92] (port=37858 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pb9B0-0002fa-Qg for emacs-orgmode@gnu.org; Fri, 07 Jan 2011 05:04:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pb9Ay-0004XY-Q2 for emacs-orgmode@gnu.org; Fri, 07 Jan 2011 05:04:06 -0500 Received: from mail-ew0-f41.google.com ([209.85.215.41]:45159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pb9Ay-0004XS-G7 for emacs-orgmode@gnu.org; Fri, 07 Jan 2011 05:04:04 -0500 Received: by ewy27 with SMTP id 27so8456630ewy.0 for ; Fri, 07 Jan 2011 02:04:03 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: cbaoqiu@yahoo.com Cc: emacs-orgmode@gnu.org --===============1187996376== Content-Type: multipart/signed; boundary="===-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --===-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Baoqiu, A file with the following contents fails to export to Docbook: #+begin_src org ,* Table with a backslash in it =20=20 , | \ | =20=20 #+end_src It gives the following error=20 #+begin_example "Invalid use of `\' in replacement text" #+end_example The following changes (replace-match literally in `org-export-docbook-finalize-table') solves this problem for me, but I would not know whether this would break anything else. #+begin_src diff diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index 91ebb97..ed835b0 100644 =2D-- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -1367,7 +1367,7 @@ TABLE is a string containing the HTML code generated = by (match-string 1 table) (match-string 4 table) "") =2D nil nil table) + nil t table) table)) ;; Change into if caption does not exist. (if (string-match @@ -1377,7 +1377,7 @@ TABLE is a string containing the HTML code generated = by (match-string 1 table-with-label) (match-string 3 table-with-label) "") =2D nil nil table-with-label) + nil t table-with-label) table-with-label))) =20 ;; Note: This function is very similar to #+end_src Regards, Niels. =2D- http://pft.github.com --==-=-= Content-Type: text/html Content-Transfer-Encoding: quoted-printable

Hi Baoqiu,

A file with the following contents fails to export to Docbook:

* Table with a b=
ackslash in it

  | \ |

It gives the following error=20

"Invalid use of `\' in replacement text"

The following changes (replace-match literally in `org-export-docbook-finalize-table') solves this problem for me, but I would not know whether this would break anything else.

diff --git a/li=
sp/org-docbook.el b/lisp/org-docbook.el
index 91ebb97..ed835b0 100644
--- a/lisp/org-docbook.el
+++ b/=
lisp/org-docbook.el
@@ -1367,7 +1367,7 @@ TABLE is a string containing=
 the HTML code generated by
                     (match-string 1 table)
                     (match-string 4 table)
                     "</table>")
-                nil nil table)
+                nil t table)
        table))
     ;; Change <table> into <informaltable> if caption does not=
 exist.
     (if (string-match
@@ -1377,7 +1377,7 @@ TABLE is a string containing=
 the HTML code generated by
                   (match-string 1 table-wi=
th-label)
                   (match-string 3 table-with-label)
                   "</informaltable>")
-              nil nil table-with-label)
+              nil t table-with-label)
       table-with-label)))

 ;; Note: This function is very similar to

Regards, Niels.

=2D-

http://pft.github.com

--==-=-=-- --=-=-=-- --===-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAk0m5PQACgkQaDYruO90Vs2u/QCeM+Crs6MKfHNaaWspJyn87hMI MVwAnj+1mFOud50RXS59XmJToO9dlhU4 =+3Uv -----END PGP SIGNATURE----- --===-=-=-- --===============1187996376== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1187996376==--