From 4d77e6adf6af1c64f771805a57a62e15ab0510c3 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 17 Feb 2012 18:54:23 +0100 Subject: [PATCH] org-e-ascii: Correctly expand syntax in table cells * EXPERIMENTAL/org-e-ascii.el (org-e-ascii-table): Translate cells into ASCII/Latin1/UTF-8 before building back the table. --- EXPERIMENTAL/org-e-ascii.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/EXPERIMENTAL/org-e-ascii.el b/EXPERIMENTAL/org-e-ascii.el index 2aeebbd53..ec9451fd0 100644 --- a/EXPERIMENTAL/org-e-ascii.el +++ b/EXPERIMENTAL/org-e-ascii.el @@ -1613,14 +1613,22 @@ CONTENTS is nil. INFO is a plist holding contextual information." (special-col-p (plist-get table-info :special-column-p)) (alignment (plist-get table-info :alignment)) (clean-table (org-export-clean-table raw-table special-col-p)) - ;; Change table into lisp, much like `org-table-to-lisp', - ;; being more careful about keeping the exact length of - ;; cells, for alignment purpose. + ;; Change table into lisp, much like + ;; `org-table-to-lisp', being more careful about keeping + ;; the exact length of cells, for alignment purpose. + ;; Cells are parsed and transcoded along the way. (lisp-table (mapcar (lambda (line) (if (string-match org-table-hline-regexp line) 'hline - (org-split-string (org-trim line) "\\s-?|\\s-?"))) + (mapcar + (lambda (cell) + (org-export-secondary-string + (org-element-parse-secondary-string + cell + (cdr (assq 'item org-element-string-restrictions))) + 'e-ascii info)) + (org-split-string (org-trim line) "\\s-?|\\s-?")))) (org-split-string clean-table "[ \t]*\n[ \t]*"))) ;; Compute real column widths. (column-widths