branch: externals/org
commit 10325e064ce94d272e59a7c584f58addd859f1a8
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    org-table-convert-region: Convert newlines to spaces in csv tables
    
    * lisp/org-table.el (org-table-convert-region): Consider newlines
    inside "..." in csv field.  When newlines do happen, replace them with
    spaces as we cannot have newlines in Org table cells.
    
    Reported-by: Guillaume MULLER <[email protected]>
    Link: https://orgmode.org/list/[email protected]
---
 lisp/org-table.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 29c7cbfcba..13ce835e22 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -919,8 +919,8 @@ nil      When nil, the command tries to be smart and figure 
out the
          (cond
           ((looking-at "^") (insert "| "))
           ((looking-at "[ \t]*$") (replace-match " |") (forward-line 1))
-          ((looking-at "[ \t]*\"\\([^\"\n]*\\)\"")
-           (replace-match "\\1")
+          ((looking-at "[ \t]*\"\\([^\"]*\\)\"")
+           (replace-match (replace-regexp-in-string "\n" " " (match-string 1)) 
t t)
            (if (looking-at "\"") (insert "\"")))
           ((looking-at "[^,\n]+") (goto-char (match-end 0)))
           ((looking-at "[ \t]*,") (replace-match " | "))

Reply via email to