Browse Source

ox.el (org-export-table-cell-alignment): Treat an empty cell as a number if it follows a number

* ox.el (org-export-table-cell-alignment): Treat an empty cell
as a number if it follows a number.

Thanks to Kodi Arfer for reporting this.
Bastien Guerry 12 years ago
parent
commit
9cd0810f90
1 changed files with 7 additions and 2 deletions
  1. 7 2
      lisp/ox.el

+ 7 - 2
lisp/ox.el

@@ -4259,7 +4259,8 @@ Possible values are `left', `right' and `center'."
 	 (table (org-export-get-parent-table table-cell))
 	 (number-cells 0)
 	 (total-cells 0)
-	 cookie-align)
+	 cookie-align
+	 previous-cell-number-p)
     (mapc
      (lambda (row)
        (cond
@@ -4289,7 +4290,11 @@ Possible values are `left', `right' and `center'."
 			(elt (org-element-contents row) column))
 		       info)))
 	   (incf total-cells)
-	   (when (string-match org-table-number-regexp value)
+	   ;; Treat an empty cell as a number if it follows a number
+	   (if (not (or (string-match org-table-number-regexp value)
+			(and (string= value "") previous-cell-number-p)))
+	       (setq previous-cell-number-p nil)
+	     (setq previous-cell-number-p t)
 	     (incf number-cells))))))
      (org-element-contents table))
     ;; Return value.  Alignment specified by cookies has precedence