diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index 42f234790c5..9a72eb5f314 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -6132,9 +6132,13 @@ supported." (with-temp-buffer (insert (orgtbl-to-orgtbl table params)) (org-table-align) - (replace-regexp-in-string - "-|" "-+" - (replace-regexp-in-string "|-" "+-" (buffer-substring 1 (buffer-size)))))) + (goto-char (point-min)) + (while (search-forward "-|" nil t) + (replace-match "-+")) + (goto-char (point-min)) + (while (search-forward "|-" nil t) + (replace-match "+-")) + (buffer-string))) (defun orgtbl-to-unicode (table params) "Convert the `orgtbl-mode' TABLE into a table with unicode characters.