瀏覽代碼

table: Small fix

* lisp/org-table.el (org-table-to-lisp): Make sure to stop at the end
of the table.
Nicolas Goaziou 4 年之前
父節點
當前提交
e955976983
共有 1 個文件被更改,包括 6 次插入7 次删除
  1. 6 7
      lisp/org-table.el

+ 6 - 7
lisp/org-table.el

@@ -5475,17 +5475,16 @@ The table is taken from the parameter TXT, or from the buffer at point."
     (save-excursion
       (goto-char (org-table-begin))
       (let ((table nil))
-        (while (search-forward "|" (line-end-position) t)
+        (while (re-search-forward "\\=[ \t]*|" nil t)
 	  (let ((row nil))
 	    (if (looking-at "-")
 		(push 'hline table)
 	      (while (not (progn (skip-chars-forward " \t") (eolp)))
-		(push
-		 (buffer-substring-no-properties
-		  (point)
-		  (progn (re-search-forward "[ \t]*\\(|\\|$\\)")
-			 (match-beginning 0)))
-		 row))
+		(push (buffer-substring-no-properties
+		       (point)
+		       (progn (re-search-forward "[ \t]*\\(|\\|$\\)")
+			      (match-beginning 0)))
+		      row))
 	      (push (nreverse row) table)))
 	  (forward-line))
         (nreverse table)))))