Browse Source

Merge branch 'maint'

Conflicts:
	lisp/org-element.el
Nicolas Goaziou 11 years ago
parent
commit
dfcfca8219
2 changed files with 6 additions and 1 deletions
  1. 1 1
      lisp/org-element.el
  2. 5 0
      testing/lisp/test-org-element.el

+ 1 - 1
lisp/org-element.el

@@ -3263,7 +3263,7 @@ CONTENTS is the contents of the object."
 Return a list whose car is `table-cell' and cdr is a plist
 containing `:begin', `:end', `:contents-begin', `:contents-end'
 and `:post-blank' keywords."
-  (looking-at "[ \t]*\\(.*?\\)[ \t]*|")
+  (looking-at "[ \t]*\\(.*?\\)[ \t]*\\(?:|\\|$\\)")
   (let* ((begin (match-beginning 0))
 	 (end (match-end 0))
 	 (contents-begin (match-beginning 1))

+ 5 - 0
testing/lisp/test-org-element.el

@@ -1912,8 +1912,13 @@ Outside list"
 
 (ert-deftest test-org-element/table-cell-parser ()
   "Test `table-cell' parser."
+  ;; Regular table cell.
   (should
    (org-test-with-temp-text "| a |"
+     (org-element-map (org-element-parse-buffer) 'table-cell 'identity)))
+  ;; Last vertical bar may be omitted.
+  (should
+   (org-test-with-temp-text "| a "
      (org-element-map (org-element-parse-buffer) 'table-cell 'identity))))