diff --git a/lisp/org-table.el b/lisp/org-table.el index 67fffc23e..f390594d1 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -5519,7 +5519,9 @@ The table is taken from the parameter TXT, or from the buffer at point." (unless (eolp) (setq p (1+ p))) p) (skip-chars-backward " \t" q) - (push (buffer-substring-no-properties q (point)) row))))) + ;; Preserve text properties. They are used when + ;; calculating cell width. + (push (buffer-substring q (point)) row))))) (nreverse row))) table) (forward-line)) diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el index 6ee790894..bfe5c3284 100644 --- a/testing/lisp/test-org-table.el +++ b/testing/lisp/test-org-table.el @@ -1849,7 +1849,21 @@ See also `test-org-table/copy-field'." (should (org-test-with-temp-text "|---|---------|\n|---|---|-----|" (org-table-align) - t))) + t)) + ;; Adjust table width. + (should + (equal + (let ((org-link-descriptive t)) + (org-test-with-temp-text " +| a | b | +|----------+---| +| [[c][c]] | d |" + (org-table-align) + (buffer-string))) + " +| a | b | +|---+---| +| [[c][c]] | d |"))) (ert-deftest test-org-table/align-buffer-tables () "Align all tables when updating buffer."